[python-win32] Can not import win32ui module the second time!

arthur arthur_hu at huawei.com
Fri Jun 17 11:17:49 CEST 2005


Hello everyone,
    I embed python 2.4 in MFC application, and call PyRun_SimpleString function to import win32ui module,
but it fails after undergoing a python initialize and cleanup process. The error info is :
"System Error: dynamic module not initialized properly".If anyone know the reason,please tell me,thanks.

The following is the code section:
void Test()
{
    Py_Initialize();
    PyRun_SimpleString("import win32ui");
    Py_Finalize();

    Py_Initialize();
    PyRun_SimpleString("import win32ui");
    Py_Finalize();
}
The first call to PyRun_SimpleString will success,but the second will fail.

Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050617/d69cd0cc/attachment.htm


More information about the Python-win32 mailing list