Embedding Python In a WINDOWS App - Help!!!!

Tim Stanka timstanka at bluefrog.biz
Sun Jul 18 18:54:38 EDT 2004


Hello,

I'm brand new to Python and WINDOWS programming. I was given the task of
integrating a scripting language into our WINDOWS MFC application. After
some
investigation I chose Python. I have played around with Python and have
written
a little test app that embeds Python into it and I have also created python
extensions using VC++ and setup.py.

Unfortunately I have a situation where extensions in DLLs need to call
functions
which are native to the WINDOWS application. I tried to talk my coworker
into
moving this functionality into DLL's or static libraries which my extension
DLLs
could link against but he was not superly receptive because we are
leveraging
a very complex existing design as our new application.

We talked about linking in the Python static library instead of the DLL but
documentation implies that Python will not be able to load DLL extensions if
the
static library is linked into an application. Does anyone have any
experience in
this area?

The WINDOWS FAQ area describes a method of using SWIG to create extensions
which are not DLLs. This would be a way to expose an application's functions
to Python and still be able to load other extensions in DLLs. Has anyone
done this?

My last question: Will Python work with any of the 3 DLL types ?(WIN32, MFC
extension DLL and MFC regular DLL)

I'm very new to all this so maybe I'm missing the big picture. If there are
other ways
to do this please feel free to indicate so.

Thanks in advance,

Tim Stanka





More information about the Python-list mailing list