windows - C++ createprocess of file in program files -
I am trying to use My problem is that I can not get it to work, for some reason I have How can I find an example to use Can you direct me to such an example? Maybe I should use a different function? Edit : This is my current code: I'm getting this for SHGetFolderPath : In addition, although I have included sstream in the headers, I am getting these errors: Note: I am using SHAgget Folder Path because I need to work on both XP and Vista / 7 Any thoughts? The problem is C style string handling that requires a Windows API: In addition, note that only CreateProcess to run the file located on the user Program file directory, so I am trying to use
CSIDL_PROGRAM_FILESX86 , because that specific program will always be in the (x86) folder.
createprocess and
CSIDL PROGRAM_FILESX86
wchar_t * localAppData = 0; SHGetFolderPath (NULL, CSIDL_PROGRAM_FILESX86, 0, NULL, and localAppData); Wstringstream SS; SS & lt; & Lt; Local AppData & lt; & Lt; L "/MyApp/MyExe.exe"; CreateProcess (static_cast & lt; zero * & gt; (LOCALAPPDATA));
wchar_t can not change parameter 5 ** to LPWSTR
'wstringstream': unverified identifier
CSIDL_PROGRAM_FILES
SHGetFolderPath is supported with.
Comments
Post a Comment