Hi Gary,
I am trying to send an event from a Python COM server to a VB (or VB.NET)
COM client.
I am a newbie both in VB and in python.
Can anyone give me a simple (but complete) code example both of the Python
server side and the VB client side for raising a single event.
Do you mean interprocess communication? If so, then you could use the
WM_CopyData message from the Windows API. However, this will only work
if the two applications are running in the same machine and if at least
one of them (the receiver) has a Window were to send the messages.
I have been used the following application to comunicate two C#
applications:
* Simple Interprocess Communications using WM_COPYDATA
http://www.vbaccelerator.com/home/NE...on/article.asp
However, the zip contains a VB.Net example as well. I haven't ever done
this with python, so, I don't know how it works. However, you could take
a look at the following thread, which discuss how to implement this
with python:
* PyWin SendMessage
http://groups.google.ch/group/comp.l...62e88d9e5d7e80
I have also tried other approaches, but they didn't work on my case, or
they require you to have additional hardware (ie: a network card), or to
install additional software (ie: Microsoft Windwos Message Queuing).
However, they might work for you:
* Windows Sockets may be the easiest solution and you can find several
examples of this with google. In my case, I didn't use them 'cause
they require my users to have a network card and my system is just
a single user application with several processes running on the same
machine.
* Named Pipes, which are a feature of windows:
- Inter-Process Communication in .NET Using Named Pipes, Part 1
http://ivanweb.com/articles/namedpipes/index.cfm
- How to use named pipes for interprocess communication in Visual
Basic .NET
http://support.microsoft.com/?kbid=871044
* Microsoft Windows Message Queuing (MSMQ) -> I don't have a VB/VB.NET
example for this; only a C# example, but it may work in VB/VB.NET
as well since if I'm not wrong, it also uses the Windows Api. Again,
I didn't used it because it requires my users to install the MSMQ
software from Microsoft, which is included with Windows.
- Using MSMQ from C#
http://www.codeproject.com/csharp/mgpMyQueue.asp
Unfortunatelly, I don't have python examples, but since they use the
Windows Api it may be possible to implement with the windows extensions
for python. You just have to look for them in the python list.
Regards,
Josef