By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

Any embedding guru out there?

P: n/a

I'm working with an embedded Python C++ application. This application
allows me to run python scripts alright. However, one of my scripts
requires importing extension modules such as socket. The script bombed
when I tried to run it. It turned out that this application only runs
Python scripts that use Pythoncore modules only.

Unfortunately I do not have access to the source code of this
at this point. In desparate attempt, I rebuilt the _socket.pyd and
placed it
in the path where the python.dll (pythoncore library) of this tool
Well, the script bombed again. However through the debugger's trace I
found something interesting.

1. C:\AutoScript\python.dll was loaded <--- embedded in app
2. D:\python\DLLs\_socket.pyd was loaded <---- came with Python I
installed on
my machine
3. C:\WINNT\System32\python23.dll was loaded <--- Python I installed
on my machine

Apparently the application was able to find and load _socket.pyd
not the one I put under C:\AutoScript). However, socket lib uses
pythoncore, hence, python23.dll was loaded. Since 2 different versions
of Pythoncore libs got loaded, it got confused and crashed. This very
likely has something to do with the path setting. I checked the
Windows registry. I could not find any key with reference to
python23.dll so I could trace where the key was used.

Your time is appreciated.
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.