Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2001, 02:31 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default How to copy a string into a pchar???????

I mean I want execute an email address like this:

ShellExecute(Application.MainForm.Handle, nil, 'mailto:' + EmailAddress, '', '', SW_SHOW);

But I need to read in the e-mail address from a label's caption which is a string...but the shellexecute needs PChar!

Can anybody plz help me?!
Reply With Quote
  #2  
Old 01-05-2001, 04:00 PM
ADMack ADMack is offline
Junior Member
 
Join Date: Nov 2000
Posts: 21
Default RE: How to copy a string into a pchar???????

Cast the string as a PChar:
ShellExecute(Application.MainForm.Handle, nil, 'mailto:' + PChar(EmailAddress), '', '', SW_SHOW);
Reply With Quote
  #3  
Old 01-05-2001, 10:10 PM
The Smurf The Smurf is offline
Member
 
Join Date: Jan 2001
Posts: 40
Default RE: RE: How to copy a string into a pchar???????

ShellExecute(Application.MainForm.Handle, nil, 'mailto:' + PChar(EmailAddress), '', '', SW_SHOW);

Actually, that bit of code won't work correctly. You need to cast the entire string.

ShellExecute(Application.MainForm.Handle,nil,PChar ('mailto:' + EmailAddress),'','',SW_SHOW);

-- The Smurf.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:04 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.