It's too strange!!! STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof STARTUPINFO; CHAR szFolderWhereFileIsLocated[250]={0}; strcpy(szFolderWhereFileIsLocated ,"put path here"); PROCESS_INFORMATION pi; CreateProcess("A.exe", NULL, NULL, NULL, FALSE, 0, NULL, szFolderWhereFileIsLocated, &si, π); when i put these code in a console program, the sub process can open correctly. Then in my windows program, the sub process can't open file firstly, then start up the sub process again (my program will start up the sub process every 20 sec) , it's OK. Just relax
iLoveM
Posts
-
CreateProcess problem. -
CreateProcess problem.Main process: STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof STARTUPINFO; PROCESS_INFORMATION pi; CreateProcess("A.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); Sub Process: GetModuleFileName(NULL,read,1000); printf("%s\n",read); int len = strlen(read); strcpy(read+len-4,".tmp"); printf("%s\n",read); FILE *f = fopen(read,"rb"); if (f==NULL) { printf("Hello world\n"); } Just relax
-
CreateProcess problem.I have try both full path and relative, but have the same problem. Just relax
-
CreateProcess problem.A.exe use createprocess to start up B.exe, B.exe must read a local file in its folder, i found i only click B.exe, B.exe can open the local file, when A.exe start up B.exe using createprocess, B.exe fails to open the local file always. Why? Just relax
-
Create(pPage->m_nDialogID, this),program crashes,why?Thank you! Just relax
-
How to read unicode ini file on win98?I want to write a program that supports mutilanguage. so I read strings in a ini file. who can help me ? Just relax