Any embedding guru out there?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ticachua

    Any embedding guru out there?

    Hi,

    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
    application
    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
    resided.
    Well, the script bombed again. However through the debugger's trace I
    found something interesting.

    1. C:\AutoScript\p ython.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\System 32\python23.dll was loaded <--- Python I installed
    on my machine

    Apparently the application was able to find and load _socket.pyd
    (hmmm,
    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.
Working...