Arbitrary errors with c++, python, and simple mapi - basically c/c++ specific

Amanjit Gill amanjit.gill at
Wed Nov 17 21:49:43 CET 2004

Thomas Zehbe wrote:

> 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.


- I suppose you should first check if your heap is still ok - perhaps 
your usage of that specific DLL caused heap corruption. Then the py-API 
screwed up. You should try the following standard heap check from win32 
(<crtdbg.h>, _DEBUG versions)

_CrtCheckMemory() 	// to check all of the heap
_CrtIsValidPointer(..) 	// to check a specific memory region for r/w

doing _CrtCheckMemory() before and after a call can reveal alot.

- It is very important to use the same runtime library in your projects, 
this is another common cause for failure.

- MAPI is a COM library. You might try this straight c++ wrapper class 
first and see if the  simplest example works for you: Or you may 
aswell try the more simplistic CMC Common messaging calls first 
(Platform SDK).

Sorry for being _UnPythonic();

Amanjit Gill
Medical and Bioinformatics
Gynecology and Obstetrics
University Clinic Charite
Berlin, Germany

amanjit.gill at

More information about the Python-list mailing list