[python-win32] Concurrent Access to COM object from Python and VB6

Bryan Berrett bryan_berrett at kairosautonomi.com
Fri Feb 5 05:48:47 CET 2010


I have a number of programs written in VB6 that use an ActiveX control 
that allows access to a shared memory pool of variables. I successfully 
used the following code to hook into this and access the shared memory 
variables. The only problem is that when this program is active I can 
not launch any of my other programs that use the same ActiveX. They hang 
upon initialization. As soon as I terminate the Python process, the VB6 
program will finish loading and functions as expected.
I am not sure what I need to do in order for the Python program to not 
block access. If I start all the VB6 programs first and the Python 
program last, everything works and can access the shared memory variables.


import win32com.client

bewise = win32com.client.Dispatch('beWISE.Functions')

varInt = beWISE.New_var_INTEGER('varInt')
varInt.Value = 12345

varString = beWISE.New_var_STRING('varString')
varString.Value = "New Variable"



More information about the python-win32 mailing list