[wxPython] wxPython apps as COM objects

Here I go again... :slight_smile:

I want to be able to have another program control my
wxPython application, so I'm setting up my app as a COM
server. There's just one small problem with this...

I've got a separate COMServer class. In its __init__()
function, it creates my wxApp object and starts its
MainLoop. Except... that means that the __init__()
function doesn't return until the application closes, which
means that the program calling my app can't actually *do*
anything with it... Surely there must be some way to set
things up, so that this will work--there's no shortage of
COM-controlled applications, and all of them *must* have
message loops... How does one go about this? Does the COM
class need to start the app in another thread/process? (I'd
rather not mess with multithreading/IPC if I don't need to,
but if this is the right way to do it, I can....)

Jeff Shannon
Technician/Programmer
Credit International

Multiple threads may be the easiest way to do it.

I'm working (when I can) on a small library that
provides a portable API around platform-specific
intra-machine RPC mechanisms like COM (Win32),
AppleEvents (MacOS), DCOP (KDE), CORBA (Gnome).

So far, I have a first draft of the Win32 COM
implementation and it works fine when used
from a wxPython app.

Take a look at qasid.sourceforge.net and browse
the CVS. You should find the library as well
as the sample wxPython app that uses the library.

Let me know if this is useful to you.

Manoj

Jeff Shannon wrote:

···

I want to be able to have another program control my
wxPython application, so I'm setting up my app as a COM
server. There's just one small problem with this...

I've got a separate COMServer class. In its __init__()
function, it creates my wxApp object and starts its
MainLoop. Except... that means that the __init__()
function doesn't return until the application closes, which
means that the program calling my app can't actually *do*
anything with it... Surely there must be some way to set
things up, so that this will work--there's no shortage of
COM-controlled applications, and all of them *must* have
message loops... How does one go about this? Does the COM
class need to start the app in another thread/process? (I'd
rather not mess with multithreading/IPC if I don't need to,
but if this is the right way to do it, I can....)

Jeff Shannon
Technician/Programmer
Credit International

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users