Generate UI with xrc file, wxChoice control operation has error.

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
lthcwebb
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Sep 23, 2021 9:22 pm

Generate UI with xrc file, wxChoice control operation has error.

Post by lthcwebb »

Generate UI with xrc file:

Code: Select all

	wxXmlResource::Get()->InitAllHandlers();
	wxXmlResource::Get()->Load(wxT("res\\Launcher.xrc"));
then....

Code: Select all

    
    wxChoice* gameCtrl = XRCCTRL(*this, "ID_CHOICE_GAMEPROCESS", wxChoice);
    if (gameCtrl == nullptr)
        return;
    gameCtrl->Clear();
Error Info: __vfptr==0xffffffff
Image
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Generate UI with xrc file, wxChoice control operation has error.

Post by doublemax »

I tested the code you posted on Trac and it worked for me.

Make sure you're linking the correct wx libraries and that they were built with the same configuration as your app.
Use the source, Luke!
lthcwebb
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Sep 23, 2021 9:22 pm

Re: Generate UI with xrc file, wxChoice control operation has error.

Post by lthcwebb »

I already know why.

Debug project only use Debug wxWidgets.

Thank very much...
Post Reply