المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Converting TCHAR to LPSTR to be used in CreateProcess [modified]



C++ Programming
01-30-2010, 01:00 AM
Hi,

I need to create a process like

LPTSTR szCmdline[] = TEXT("ffmpeg -i " + ofn.lpstrFile + " -r 1 -ss 00:00:10 -vframes 1 -f image2 " + Buffer + "\\Initframe10.bmp");

For this I will be using CreateProcess API but problem is how to convert TCHAR to a LPTSTR lpCommandLine to be passed to CreateProcess?

ofn.lpstrFile (LPTSTR type) is obtained as outcome of GetOpenFileName API Call and Buffer (TCHAR type) is obtained as GetTempPath.

I get compilation errors which I am not able to fix. (I am new to Win32 programming so this may sound naive).

Can someone please help me in fixing the errors?

Thanks

modified on Thursday, January 28, 2010 7:30 AM