Arbitrary errors with c++, python, and simple mapi

Thomas Zehbe tz at
Wed Nov 17 12:37:32 CET 2004

Hi all,
I´m programming a wxWidgets application using MSVC++ 6.0 on WinXp, SP1, 
reportlab 1.19 and simple mapi.

I programmend python modules, which call the reportlab modules. My python 
modules are called from C++ using the API.
Everything works fine until I did the first call to a function in the 
mapi32.dll. The loading of the dll doesn´t matter, but any call to the mapi, 
i.E. MAPLogon, leads to arbitrary errors calling the Py-API.
        pDict = PyModule_GetDict(pModule); 
        pFunc = PyDict_GetItemString(pDict, func);
Doing this before a mapi call and calling PyDict_Keys(pDict) returns a list of 
91 keys including the function func. Doing it after a mapi call 
PyDict_Keys(pDict) returns a list of only 15 Keys without the function func.
Doing the calls before and after a mapi call, a callable pFunc is returned in 
both cases, but the pFunc retrieved after the mapi call doesn´t work anymore. 
         pValue = PyObject_CallObject(pFunc, pArgs);
returns 0x0 and no pdf file is generated.

Seems that  the MS dlls are peeking and poking around in the python 
interpreter memory.

Has anybody seen this happen, too? How can I debug it. All print statements 
from within the python modules seem to go to /dev/null, as do
            if (pErr = PyErr_Occurred())
Any help would be appreciated.
Thomas Zehbe

Luther Weg 50
31515 Wunstorf

Tel 05031-902042
Fax 05031-902049

More information about the Python-list mailing list