I have a small activex control that is running on Windows mobile 6. I able to use the api CreateProcessW when I hard code the Application name L"\blah\blah.exe".
When I call another API that returns a BSTR which contains the application that I want to pass to the CreateProcessW it doens't work. I have checked and the application string is populated but I am guesing I am having a conversion problem between BSTR and LPCWSTR (Wide cha error?) . I have tried converting it with OLE2CW and OLE2W.
I am not a VC expert and I only need to get this working so my question is.
- When I receive a BSTR via a API how would I convert it to be able to pass it to the Application parameter in CreateProcessW? This is windows mobile 6 (Wince 5.2). A Code snippet would be great.
Code Example without any conversion:
BSTR app = NULL;
_host->GetAppString(_T("app"),&app);
CreateProcessW(app,L"22222",0,0,0,0,0,0,0,&processInformation);
The character set is Unicode.
Thanks