ShellExecute() problem
ok so i have used ShellExecute() before but with a specific value eg. "http://www.facebook.com" but now i want this program to be more flexible and allow the user to put the website he wants to.
the thing is i made a string like this
String ^URL;
ShellExecute(NULL,"open",URL,NULL,NULL,SW_SHOWDEFAULT)
this gives me an error saying cannot convert system::string into LPCSTR.
btw i am using windows forms applications, how can i fix this? D:
thnx :D
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
he's right, it's .NET string
which is
system::string...
need help plz :O
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
thnx. lemme try that and get back to you ;)
i keep getting :
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(90) : error C3641: 'InterlockedExchangePointer' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(102) : error C3641: 'ATL::_AtlGetConversionACP' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(535) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(554) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(572) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(577) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(530) : error C3641: 'AtlDevModeW2A' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h(65) : error C2440: 'default argument' : cannot convert from 'int (__cdecl *)(int,const char *,int,const char *,const char *,...)' to 'ATL::CTrace::fnCrtDbgReport_t'
1> Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h(146) : fatal error C1903: unable to recover from previous error(s); stopping compilation
that error when this is my code...
String ^siteURL1;
CString button1URL(&siteURL1);
ShellExecute(NULL,"open",button1URL,NULL,NULL,SW_SHOWDEFAULT);
D: now im gna read that article..
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
bump!
i really need help on this :(
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
Here's a thread on the conversion. Can't test it because I don't use managed code.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
zomg thnx again :)
u've helped me a whole bunch.. mind PMing me ur MSN? :P
oooh i dun understand that whole thing cuz im still learning C++ from a book and was just making these programs to learn...
well the basic idea of that is to convert system::string to a char array yea?
if so then i can refer to that once i learn about char arrays.
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
mind PMing me ur MSN? :P
Yes, actually Ido mind. Keep the discussion in the forum.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
kay then... :P
i need some more help...
how do i add a string in between a text parameter? google doesn't help much :(
something like
string name;
MessageBox(NULL,"Hello,"(name)"sucks",":D",MB_ICONINFORMATION);
i tried that and it keeps giving me errors D:
some help plz ..
evilguyme
Junior Poster in Training
71 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0