Recently I made a little program that could open files/exes/links. (facebook, vs 2012, ect ect) But it was in the command prompt. Worked perfect.
I decided to make a forms application to do just the same, except through buttons instead of user input. But I keep running across this problem...
error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char ' to 'LPCWSTR'
ShellExecute(NULL, "open", "www.facebook.com", NULL, NULL, SW_SHOWNORMAL);
So I did some google'n and came across advice that suggested that I go to project menu->properties->general->character set and change that to not set from unicode.
then i got even more errors. then was told to add .c_str() to the URL,
ShellExecute(NULL, "open", "www.facebook.com".c_str(), NULL, NULL, SW_SHOWNORMAL);
Form1.h(83): error C2228: left of '.c_str' must have class/struct/union
1> type is 'const char '
I have been trying to defeat this issue, but I fail. I have searched nearly everything. If anyone could either point me in the right direction or just help me, I'll be happy.
just incase...im trying to just open whatever i want. so a button for facebook to open firefox with fb open. or a button for starcraft for example, then it can open starcraft.
Sorry for poor spelling/grammar...lack of sleep/idc
thanks for your time and help in advance!