i have add these line in the *App.cpp beacuse if i understand well this is the "main" equivalent (i have to force a single instance and start threads)
but since i have add these line the project is stucs, even if i delete my lines nothing start
whent a paus a debug session it say :
In ntdll!DbgBreakPoint () (C:\WINDOWS\SYSTEM32\ntdll.dll)
( i have put //my added lines were i made changes)
/***************************************************************
* Name: SimNetServApp.cpp
* Purpose: Code for Application Class
* Author: ()
* Created: 2022-03-24
* Copyright: ()
* License:
**************************************************************/
#include "SimNetServApp.h"
//my added lines
#include <windows.h>
//(*AppHeaders
#include "SimNetServMain.h"
#include <wx/image.h>
//*)
IMPLEMENT_APP(SimNetServApp);
bool SimNetServApp::OnInit()
{
//(*AppInitialize
bool wxsOK = true;
wxInitAllImageHandlers();
if ( wxsOK )
{
SimNetServFrame* Frame = new SimNetServFrame(0);
Frame->Show();
SetTopWindow(Frame);
}
//*)
//my added lines
CreateMutexA(0, FALSE, "Local\\$TSimUdpServApp$");
if(GetLastError() == ERROR_ALREADY_EXISTS){
//" an other instance of SimServer is running ...";
return false;
}
return wxsOK;
}