Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: jean-raphael on March 24, 2022, 03:03:46 PM

Title: Wxsmith / wxwdget app is not starting
Post by: jean-raphael on March 24, 2022, 03:03:46 PM
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;
}

Title: Re: Wxsmith / wxwdget app is not starting
Post by: Miguel Gimenez on March 24, 2022, 03:46:37 PM