I'm trying to perform the type conversion as shown in the subject title. Below shows the working copy of my code relevant to this conversion so far:
If I try using the green highlighted code, I'm getting the following error message:
LPCSTR lpszOutput = "c:\\PDFTron_before.pdf";
File.cbSize = sizeof(SHELLEXECUTEINFOW);
File.hwnd = NULL;
File.lpVerb = L"open";
File.lpFile = lpszOutput;
If I try replacing the highlighted code with:
1>c:\pdftron_vprint\shellscript\shellscript.cpp(20) : error C2440: '=' : cannot convert from 'LPCSTR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I'm getting a runtime error saying that File was used without being initialized. Does it imply that I should be allocating memory to File.lpFile?
int byteWritten = MultiByteToWideChar(CP_ACP,