Probleme mit CreateProcess.....



  • hallo, ich habe eine mfc-anwendung, die teile aus einer dll benutzt.
    diese dll enthält eine methode zum starten eines externen programms.
    allerdings passiert NICHTS !
    Der rückgabewert von createprocess ist true, GetLastError liefert auch 0.

    kopiere ich die methode in ein exe file, und führe die exefilemethode aus funktioniert das.

    da ich das aber dringend in der dll benötigte, bitte ich um hilfe !!!

    void MyDLL::Start()
    {
       HANDLE hProcess = 0;
       STARTUPINFO StartupInfo = {0};
       PROCESS_INFORMATION ProcessInfo;
       StartupInfo.cb          = sizeof(StartupInfo);
       StartupInfo.dwFlags     = STARTF_USESHOWWINDOW | STARTF_FORCEONFEEDBACK;
       StartupInfo.wShowWindow = SW_SHOW;
       CString strPath="c:\\test\\test.exe";
       BOOL b = CreateProcess(strPath, 0, 0,0, true, 0, 0, 0, &StartupInfo,   &ProcessInfo);	// rückgabewert ist true	
       DWORD dwLastError = GetLastError(); // liefert 0
       CloseHandle(ProcessInfo.hThread);
       hProcess = ProcessInfo.hProcess;
    }
    


  • Das Problem liegt wohl nicht an diesem Stück Code.
    Bist Du sicher, dass Du die DLL richtig lädst etc.?


Anmelden zum Antworten