Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » I keep getting the same "cannot open exe for writing" error...
Re: I keep getting the same "cannot open exe for writing" error... [message #50717 is a reply to message #50712] Sat, 08 December 2018 19:27 Go to previous messageGo to previous message
peterh is currently offline  peterh
Messages: 46
Registered: November 2018
Location: Germany
Member
New Code:
void Pdb::Stop()
{
	DWORD retval;
	LOG("---------------------------------------");
	LOG("terminated flag");
	DUMP(terminated);
	if(!terminated) {
		terminated = true;
		SaveTree();
		String fn = ConfigFile("TreeTypes.txt");
		FileOut out(fn);
		for(int i = 0; i < treetype.GetCount(); i++)
			out << treetype.GetKey(i) << "\r\n" << treetype[i] << "\r\n";
		StringStream ss;
		Store(callback(this, &Pdb::SerializeSession), ss);
		WorkspaceConfigData("pdb-debugger") = ss;
		if(hProcess == INVALID_HANDLE_VALUE)
          { LOG("hProcess Handle is invalid handle value");};

		if(hProcess != INVALID_HANDLE_VALUE) {
			LOG("DebugActiveProcessStop");
			for(int i=0; i<10; i++){
				if (retval = DebugActiveProcessStop(processid)) break;
				DUMPHEX(retval);
            	                Sleep(100);
			}
			DUMPHEX(retval);
			
			retval = TerminateProcess(hProcess, 0);
			LOG("TerminateProcess");
			DUMPHEX(retval);
			retval = WaitForSingleObject(hProcess,10000);
			LOG("WaitForSingleObject");
			DUMPHEX(retval);
#ifdef NEVEREVER
			retval = MsgWaitForMultipleObjects(
							1, 			//DWORD        nCount,
							&hProcess, 	//const HANDLE *pHandles,
							true, 		//BOOL         fWaitAll,
							10000, 		//DWORD        dwMilliseconds,
							0  			//DWORD        dwWakeMask
							);
			LOG("WaitForMultibleObjects");
			DUMPHEX(retval);
#endif
			while(threads.GetCount())
				RemoveThread(threads.GetKey(0)); // To CloseHandle
			UnloadModuleSymbols();
			SymCleanup(hProcess);
			retval = CloseHandle(hProcess);
			LOG("CloseHandle");
			DUMPHEX(retval);
		}
		StoreToGlobal(*this, CONFIGNAME);
		IdeRemoveBottom(*this);
		IdeRemoveRight(disas);
	}
}

[Updated on: Sat, 08 December 2018 19:29]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: error: expected unqualified-id before '=' token
Next Topic: clang or MinGW
Goto Forum:
  


Current Time: Thu Aug 06 23:32:36 CEST 2020

Total time taken to generate the page: 0.01212 seconds