[python-win32] Can not import win32ui module the second time!
Mark Hammond
mhammond at skippinet.com.au
Sat Jun 18 08:27:23 CEST 2005
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: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of arthur
Sent: Friday, 17 June 2005 7:18 PM
To: python-win32 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050618/be5d0ef1/attachment.htm
More information about the Python-win32
mailing list