Kirix Support Forums

wxWebControl::InitEngine fails at runtime

Please post all general questions, comments, bug reports, and any other wxWebConnect feedback here.

wxWebControl::InitEngine fails at runtime

Postby gillesp on Tue Oct 06, 2009 10:42 am

Hello
I successfully compiled the textapp example provided with the wxWebconnect sources.
I used wxDevCpp/MingW as IDE/compiler under MSWindows.
The size of my executable is ~4MB compared to 1.4 MB for the executable provided with the sources.
Although the executable provided with the sources works properly on my computer, the one that I compiled does not work (brutal failure when lauched).

After some inquiries, it turns out that the function that fails is wxWebControl::InitEngine (the path provided for XULRunner is correct). It fails when setting the window creator at line
ns_smartptr<nsIWindowWatcher> window_watcher = nsGetWindowWatcherService(); in webcontrol.cpp.

The function ns_smartptr<nsIWindowWatcher> nsGetWindowWatcherService() in nsimpl.cpp seems to run properly as the error only occurs when returning the value.

Any idea to correct/pass through this bug ?
Many thanks in advance
gillesp
Registered User
 
Posts: 7
Joined: Tue Oct 06, 2009 10:30 am

Re: wxWebControl::InitEngine fails at runtime

Postby gillesp on Wed Oct 07, 2009 2:08 am

Hint : the only warning appearing during the compilation is :
nsptr.h [Warning] base class `class ns_smartptr_unknown' should be explicitly initialized in the copy constructor
at line 46 of nsptr.h : ns_smartptr(const ns_smartptr<T>& c) which defines the function :
ns_smartptr(const ns_smartptr<T>& c)
{
p = c.p;
if (p)
{
p->AddRef();
}
}

Any idea to suppress the warning and correct the bug ?
gillesp
Registered User
 
Posts: 7
Joined: Tue Oct 06, 2009 10:30 am

Re: wxWebControl::InitEngine fails at runtime

Postby Ben on Fri Oct 09, 2009 3:26 pm

That strikes me as a little pedantic on the part of MinGW, because ns_smartptr_unknown() has no data members. However, let's try to accommodate it and see it that solves other people's problems with wxWebConnect and mingw.

Open up nsptr.h and add this to all four constructor definitions:

Code: Select all
: ns_smartptr_unknown()


So, the definition for the constructor you mentioned should look like this:

Code: Select all
ns_smartptr(const ns_smartptr<T>& c) : ns_smartptr_unknown()


Let's see how far we get with that. Thanks for your post.

Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: wxWebControl::InitEngine fails at runtime

Postby gillesp on Thu Oct 29, 2009 3:34 am

Thank you for your sugestion.
Yes, I did modify the 4 constructors accordingly. But the runtime error still persists.

To locate the error, I wrote marks (flushed) to a text log file after each instruction in function "bool GeckoEngine::Init()" (webcontrol.cpp).
All the lines are executed until "window_watcher = nsGetWindowWatcherService();".
Then I did the same in function "ns_smartptr<nsIWindowWatcher> nsGetWindowWatcherService()" (nsimpl.cpp).
All the function instructions are executed until the last one "return result;".

So, it seems that the runtime error occurs in returning the function result, which is a "ns_smartptr<nsIWindowWatcher>"...
Is it possible to perform tests on simple functions returning ns_smartptr or any other hint to solve the issue ?
gillesp
Registered User
 
Posts: 7
Joined: Tue Oct 06, 2009 10:30 am

Return to wxWebConnect Questions, Thoughts & Feedback