diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 93385a47d1..3c6c604055 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -102,6 +102,10 @@ extern WXDLLIMPEXP_PROPGRID wxPGGlobalVarsClass* wxPGGlobalVars; #define wxPGVariant_Bool(A) (A?wxPGVariant_True:wxPGVariant_False) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +WXDLLIMPEXP_PROPGRID void wxPGInitResourceModule(); + #endif // !SWIG // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 9e38fc6450..cb94580aff 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -154,6 +154,15 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxPGGlobalVarsClassManager, wxModule) +// When wxPG is loaded dynamically after the application is already running +// then the built-in module system won't pick this one up. Add it manually. +void wxPGInitResourceModule() +{ + wxModule* module = new wxPGGlobalVarsClassManager; + module->Init(); + wxModule::RegisterModule(module); +} + wxPGGlobalVarsClass* wxPGGlobalVars = NULL;