In general, finalizing and re-initializing Python has a number of issues - these functions were not designed to be called that way.
 
(Please try and send plain-text mails to this list (for some reason my mailer refuses to even switch my reply back to plain-text))
 
Mark
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of arthur
Sent: Friday, 17 June 2005 7:18 PM
To: python-win32@python.org
Subject: [python-win32] Can not import win32ui module the second time!

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
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to