From: bray on
Hello:

I wish use wxWidgets from DLLs. I used this code:

class wxNoneAppA : public wxApp
{
public:
virtual bool OnInit() { return true; }
};

IMPLEMENT_APP_NO_MAIN( wxNoneAppA )

Then call wxInitialize() when it loads. It works fine by itself (not
used in a wxApp). However, when I load from a wxApp, the events are
never being called from the wxApp instance. Dialogs come up but the
events are no longer being called. The same wxApp without the DLL calls
the events. I presume the DLL instance is intercepting these, no?

Any ideas on what I may be doing wrong?

Regards, Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Les Newell on
Are you always going to be calling this dll from a wx app? If so then
make sure that you use wx as a dll then pass a copy of your main
application's instance pointer (wxApp::GetInstance()) to your dll. In
the dll use wxApp::SetInstance() with that pointer. This will
synchronise the two instances.

Les

bray(a)sent.com wrote:
> Hello:
>
> I wish use wxWidgets from DLLs. I used this code:
>
> class wxNoneAppA : public wxApp
> {
> public:
> virtual bool OnInit() { return true; }
> };
>
> IMPLEMENT_APP_NO_MAIN( wxNoneAppA )
>
> Then call wxInitialize() when it loads. It works fine by itself (not
> used in a wxApp). However, when I load from a wxApp, the events are
> never being called from the wxApp instance. Dialogs come up but the
> events are no longer being called. The same wxApp without the DLL calls
> the events. I presume the DLL instance is intercepting these, no?
>
> Any ideas on what I may be doing wrong?
>
> Regards, Brian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: bray on
Les:

Thanks for you feedback.

I see what your saying about synchronizing the two. However, I was
curiors about why wx needs to be used as a dll for this to work. What is
wrong with statically linking?

Regards,

Brian


On Fri, 01 Sep 2006 17:38:32 +0100, "Les Newell" <lesnewell(a)fmail.co.uk>
said:
> Are you always going to be calling this dll from a wx app? If so then
> make sure that you use wx as a dll then pass a copy of your main
> application's instance pointer (wxApp::GetInstance()) to your dll. In
> the dll use wxApp::SetInstance() with that pointer. This will
> synchronise the two instances.
>
> Les
>
> bray(a)sent.com wrote:
> > Hello:
> >
> > I wish use wxWidgets from DLLs. I used this code:
> >
> > class wxNoneAppA : public wxApp
> > {
> > public:
> > virtual bool OnInit() { return true; }
> > };
> >
> > IMPLEMENT_APP_NO_MAIN( wxNoneAppA )
> >
> > Then call wxInitialize() when it loads. It works fine by itself (not
> > used in a wxApp). However, when I load from a wxApp, the events are
> > never being called from the wxApp instance. Dialogs come up but the
> > events are no longer being called. The same wxApp without the DLL calls
> > the events. I presume the DLL instance is intercepting these, no?
> >
> > Any ideas on what I may be doing wrong?
> >
> > Regards, Brian
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Rick Sivernell on
On Fri, 01 Sep 2006 12:41:14 -0500
bray(a)sent.com wrote:

> Les:
>
> Thanks for you feedback.
>
> I see what your saying about synchronizing the two. However, I was
> curiors about why wx needs to be used as a dll for this to work. What is
> wrong with statically linking?
>
> Regards,
>
> Brian
>

Brian

Static Link = large foot prints, slower programs.
dll = small foot prints, faster programs, if you do not change the
api signature, the code changes only require rebuilding the
dll, not the whole program. Less work.

--
Rick Sivernell
Dallas, Texas 75287
972 306-2296
ricksivernell(a)verizon.net
Registered Linux User


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "Iulian-Nicu Serbanoiu" on
this has been discussed on the list some time ago ( I was also
interested in such things ):

http://www.gatago.com/comp/soft-sys/wxwindows/15930613.html

All I have to say: use the dynamic version of the library in any
system if you want to do such things without headaches.

HTH,

Iulian

On 9/1/06, bray(a)sent.com <bray(a)sent.com> wrote:
> Les:
>
> Thanks for you feedback.
>
> I see what your saying about synchronizing the two. However, I was
> curiors about why wx needs to be used as a dll for this to work. What is
> wrong with statically linking?
>
> Regards,
>
> Brian
>
>
> On Fri, 01 Sep 2006 17:38:32 +0100, "Les Newell" <lesnewell(a)fmail.co.uk>
> said:
> > Are you always going to be calling this dll from a wx app? If so then
> > make sure that you use wx as a dll then pass a copy of your main
> > application's instance pointer (wxApp::GetInstance()) to your dll. In
> > the dll use wxApp::SetInstance() with that pointer. This will
> > synchronise the two instances.
> >
> > Les
> >
> > bray(a)sent.com wrote:
> > > Hello:
> > >
> > > I wish use wxWidgets from DLLs. I used this code:
> > >
> > > class wxNoneAppA : public wxApp
> > > {
> > > public:
> > > virtual bool OnInit() { return true; }
> > > };
> > >
> > > IMPLEMENT_APP_NO_MAIN( wxNoneAppA )
> > >
> > > Then call wxInitialize() when it loads. It works fine by itself (not
> > > used in a wxApp). However, when I load from a wxApp, the events are
> > > never being called from the wxApp instance. Dialogs come up but the
> > > events are no longer being called. The same wxApp without the DLL calls
> > > the events. I presume the DLL instance is intercepting these, no?
> > >
> > > Any ideas on what I may be doing wrong?
> > >
> > > Regards, Brian
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org