wxHtmlWindow doesn't render HTML

Franky Braem f.braem at skynet.be
Sun Dec 23 12:31:10 PST 2007


personaje wrote:
> On Dec 20, 2007 4:30 AM, Stefan Csomor <csomor at advancedconcepts.ch> wrote:
>> Hi
>>
>> Franky Braem wrote:
>>> chris elliott wrote:
>>>>
>>>> Franky Braem wrote:
>>>>
>>>>> When the wxHtmlWindow is created in the exe everything works ok.
>>>>> When the wxHtmlWindow is created in a DLL, it doesn't work.
>>>> Thank, you, but if I am to look at this, I need to know exactly which
>>>> sample shows the bug, (and which compiler/and wxversion)
>>>> chris
>>>>
>>> It's a little bit difficult to write a sample application. It's my
>>> wxJavaScript shell program, that is used as exe and a dll which is
>>> used as port to wxHtmlWindow. I have found out that when I load
>>> wxmsw28ud_html_vc_custom.dll with LoadLibrary before doing anything
>>> else, the tag handlers are correctly registered. When I don't do this,
>>> no handler is registered.
>> the problem is probably that the wxModule that is responsible for
>> loading must be in the wx'modules list already at the right moment, in
>> order to be initialized properly. So if you load the lib after the wx
>> module init sequence has been executed it is too late, and these will
>> not be initialized. You would have to use something like
>> wxPluginManager::LoadLibrary which on its turn executes a
>> RegisterModules call on the wxPluginLibrary which initializes newly
>> added wxModules.
> 
> can you suggest a modification for my example that would work?
> 
> thanks
> 
I've got it working now by loading the gui dll with wxPluginManager and 
by adding the following in the gui dll:

#include <wx/html/htmlwin.h>

class wxGUIModule: public wxModule
{
public:
     wxGUIModule()
     {
     }

     virtual bool OnInit()
     {
       AddDependency(CLASSINFO(wxHtmlWinParser));
       return true;
     }

     virtual void OnExit()
     {
     }

private:
     DECLARE_DYNAMIC_CLASS(wxGUIModule)
};

IMPLEMENT_DYNAMIC_CLASS(wxGUIModule, wxModule)






More information about the wx-users mailing list