Problem in SearchPath
-
I want to initialize a executable, making OS to search for the file.
STARTUPINFO si = {sizeof(si)}; PROCESS_INFORMATION pi; TCHAR szCommandLine[1024] = {0},*pszCommandLine = 0; DWORD lFileName = SearchPath(NULL,(LPCWSTR)"YPager",(LPCWSTR)".exe",(DWORD)sizeof(szCommandLine), szCommandLine, *pszCommandLine); BOOL bCreate = CreateProcessNULL,szCommandLine,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
there is no complier error but szCommandLine cannot fill the path. Any other suggestions to achieve the same goal is appreciated. Cheers! Siddharth -
I want to initialize a executable, making OS to search for the file.
STARTUPINFO si = {sizeof(si)}; PROCESS_INFORMATION pi; TCHAR szCommandLine[1024] = {0},*pszCommandLine = 0; DWORD lFileName = SearchPath(NULL,(LPCWSTR)"YPager",(LPCWSTR)".exe",(DWORD)sizeof(szCommandLine), szCommandLine, *pszCommandLine); BOOL bCreate = CreateProcessNULL,szCommandLine,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
there is no complier error but szCommandLine cannot fill the path. Any other suggestions to achieve the same goal is appreciated. Cheers! Siddharth