I have tested your code with BC++ 5.02. To make it build at all, I had =
remove "#include <mapix.h>". The latter caused "multiple declaration" =
for WCHAR and more. Removing it removed those errors without introducing =
problems, so it seems it wasn't needed. I built the project as a Win32 =
target, compiled with STRICT, _RTLDLL and _BIDSDLL defined, and linked =
the following files: "c0w32.obj", "bidsfi.lib", "import32.lib", =
and "owlwfi.lib". With those changes I tested with and without _OWLDLL
defined. Both cases ran successfully with no crash.
I also tried to build it with VC++ 6.0 SP5 and OWL Next 6.10, and the =
built and ran successfully with or without _OWLDLL defined. In this case =
used your source as is, except I had to define __MIN_MAX_DEFINED before
Are you sure the MAPI call is correct? No unitialized data somewhere =
random errors? Does LoadLibrary return a valid handle? Does =
return a valid function pointer? Could it be a w_char/Unicode problem?
Hope that helps,
[mailto:owlnext-users-admin@...] On Behalf Of Jaymie
Sent: Monday, June 06, 2005 8:48 PM
Subject: [OwlNExt-users] RE: Strange problem with MAPI running in an =
Does anyone have any insight on this issue? I'm thinking it might be
something to do with the TLS mechanism that OWLNExt uses. Could someone =
this test on a Borland platform and see if it exhibits the same problem, =
I can rule out Microsoft's CRT?
From: Jaymie Blanchard
Sent: Tue 5/31/2005 4:56 PM
Subject: Strange problem with MAPI running in an OWLNExt App.
For some reason, MAPI crashes on me when simply running from OwlMain. I =
a BAADF00D pointer in EBX at some point during a call to MAPISendMail =
can't figure out what the problem is. Simply changing OwlMain to =
and removing the defs.h include the problem goes away.
I've put together some sample code that illustrates the problem. The
following code is for MSVC++ 7. To switch between the Owl version and =
normal Win32 version, simply comment/uncomment the _OWLDLL define.
// Comment this line out to switch between OWL and Win32=20
ULONG ExecuteMapi( )=20
ZeroMemory( &recv, sizeof(recv) );=20
recv.ulReserved =3D 0;=20
recv.ulRecipClass =3D MAPI_TO;=20
recv.lpszName =3D "Test Recipient";=20
recv.lpszAddress =3D "Test.Recipient@...
recv.ulEIDSize =3D 0L;=20
recv.lpEntryID =3D NULL;=20
ZeroMemory( &msg, sizeof(msg) );=20
msg.ulReserved =3D 0;=20
msg.lpszSubject =3D "Test email for MAPI bug\r\n";=20
msg.lpszNoteText =3D "This is a test email for the MAPI =
msg.lpszMessageType =3D NULL;=20
msg.lpszDateReceived =3D NULL;=20
msg.lpszConversationID =3D NULL;=20
msg.flFlags =3D 0;=20
msg.lpOriginator =3D NULL;=20
msg.nRecipCount =3D 1;=20
msg.lpRecips =3D &recv;=20
msg.nFileCount =3D 0;=20
msg.lpFiles =3D NULL;=20
LPMAPISENDMAIL SendProc =3D =
return SendProc( NULL, 0, &msg, MAPI_LOGON_UI | MAPI_DIALOG, 0L =
int OwlMain( int, char* )=20
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )=20
hMapiLib =3D LoadLibrary( "MAPI32.DLL" );=20
ULONG uRet =3D ExecuteMapi( );=20
FreeLibrary( hMapiLib );=20
Any help would be much appreciated,=20
Visit <http://www.aderant.com> http://www.aderant.com for information =
products and services.
Visit <http://support.aderant.com> http://support.aderant.com for
information on support.=20