Hello, i would like to have a program that start a .exe . Then i do:
1 2 3 4 5
|
TCHAR name [ UNLEN + 1 ];
DWORD size = UNLEN + 1;
GetUserName( (TCHAR*)name, &size );
std::string n=name;
ShellExecute(NULL, "open", "C:\\Users\\" + n.c_str() + "\\Desktop\\myprog.exe",NULL, NULL, SW_SHOWDEFAULT);
|
I get 1 error:
error: invalid operands of types 'const char [10]' and 'LPCSTR {aka const char*}' to binary 'operator+'
Last edited on
Concatenate your string for the third argument outside of the function call and save it to a variable.