TCHAR Array to a concatenate LPCSTR
TCHAR Array to a concatenate LPCSTR I am reading a ini file and want to execute a external program (VBS File) after that. But I am having problems with the string types. This is my code. LPCTSTR path = _T(".my.ini"); TCHAR fileName[500]; int b = GetPrivateProfileString(_T("Paths"), _T("filename"), _T(""), fileName, 500, path); // fileName = myscript.vbs // I need to execute "wscript myscript.vbs arg1" // Execute script file. Doesnt work. WinExec("wscript " + fileName + " arg1", MINIMZIED); // OR. Doesnt work. system("wscript " + fileName + " arg1"); This doesnt work. WinExec wants a LPCSTR but I have the fileName in a TCHAR and want to concatenate with some other string. LPCSTR fileName TCHAR How can I convert or concatenate it correctly? 2 Answers 2 From the WinExec() documentation: This function is provide...
