Static DLL

Ash Kapur AshKapur at worldnet.att.net
Tue Feb 20 01:48:05 EST 2001


Hi,

I have an Win32 app that already loads a static dll (e.g. links with the
.lib, so
autoloads the dll when it starts). Using Dev Studio on 98.

I am trying to embed python20 into this app, so that I can use it to call
some
of the functions in the dll to test them.  The embedding went smoothly, I
can pass
command lines and file names to python and it executes them.

I used SWIG to create wrappers for some of the dll functions I want to call,
that also
went quite smoothly.

The problem is when I do an "import  dllname" it seems to load a new copy of
the dll,
(or at least there is a second set of static data at different places, and
breakpoints etc
do not work when the code is called from python).

Does anyone know of any way I can get python to know of my dll without doing
an
import, so that the already-loaded dll is used ? It would be a pain to have
to go back
to my existing app and change the architecture, as the dll exports lots of
functions.

Thanks in advance

Ash Kapur







More information about the Python-list mailing list