Discussion:
Simple MAPI Console Application with Outlook Express.
(too old to reply)
vshalarora82
2008-04-01 07:41:04 UTC
Permalink
Hi All,

I am using Simle MAPI Console Application from
Microsoft([url]http://download.microsoft.com/download/mapi/utility/21/w9xnt4/en-us/smplmapi.exe[/url]).


It works fine when my default mail client is Outlook, but when my
default mail client is outlook express then it shows an error.

[MAPIAllocateBuffer (strlen ( rgchMsgID ) + 1, (LPVOID FAR*) prgchMsgID
);
strcpy ( *prgchMsgID, rgchMsgID );]

When program allocates memory for Message ID using MAPIAllocateBuffer,
then it returns 0x80004005. After that when strcpy executes, an
excetpion (0xC0000005: Access Violation) is generated.


If you know the cause, please help me.

Thanks,
Vishal Arora



--
vshalarora82
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
David Lowndes
2008-04-01 17:51:49 UTC
Permalink
Post by vshalarora82
It works fine when my default mail client is Outlook, but when my
default mail client is outlook express then it shows an error.
[MAPIAllocateBuffer (strlen ( rgchMsgID ) + 1, (LPVOID FAR*) prgchMsgID
);
strcpy ( *prgchMsgID, rgchMsgID );]
When program allocates memory for Message ID using MAPIAllocateBuffer,
then it returns 0x80004005. After that when strcpy executes, an
excetpion (0xC0000005: Access Violation) is generated.
Clearly that code is a sample not production code. If the
MAPIAllocateBuffer has failed you should not be trying to write to
where it ought to have put the allocated buffer.

You're experiencing a symptom of a problem that's presumably occurred
sometime before these immediate lines of code - you need to do some
more debugging and compare the results you get with Outlook and OE.

Dave
Vish
2008-04-11 07:44:57 UTC
Permalink
Post by David Lowndes
Post by vshalarora82
It works fine when my default mail client is Outlook, but when my
default mail client is outlook express then it shows an error.
[MAPIAllocateBuffer (strlen ( rgchMsgID ) + 1, (LPVOID FAR*) prgchMsgID
);
strcpy ( *prgchMsgID, rgchMsgID );]
When program allocates memory for Message ID using MAPIAllocateBuffer,
then it returns 0x80004005. After that when strcpy executes, an
excetpion (0xC0000005: Access Violation) is generated.
Clearly that code is a sample not production code. If the
MAPIAllocateBuffer has failed you should not be trying to write to
where it ought to have put the allocated buffer.
You're experiencing a symptom of a problem that's presumably occurred
sometime before these immediate lines of code - you need to do some
more debugging and compare the results you get with Outlook and OE.
Dave
thanks David

Vishal
Vish
2008-04-22 04:48:27 UTC
Permalink
Post by Vish
Post by David Lowndes
Post by vshalarora82
It works fine when my default mail client is Outlook, but when my
default mail client is outlook express then it shows an error.
[MAPIAllocateBuffer (strlen ( rgchMsgID ) + 1, (LPVOID FAR*) prgchMsgID
);
strcpy ( *prgchMsgID, rgchMsgID );]
When program allocates memory for Message ID using MAPIAllocateBuffer,
then it returns 0x80004005. After that when strcpy executes, an
excetpion (0xC0000005: Access Violation) is generated.
Clearly that code is a sample not production code. If the
MAPIAllocateBuffer has failed you should not be trying to write to
where it ought to have put the allocated buffer.
You're experiencing a symptom of a problem that's presumably occurred
sometime before these immediate lines of code - you need to do some
more debugging and compare the results you get with Outlook and OE.
Dave
thanks David
Vishal
Hi David,

I came to know that MAPIAllocateBuffer is defined in Extended MAPI
header file. We can use only Simple MAPI with Outlook Express. So i
think we can't use MAPIAllocateBuffer with Outlook Express.

Regards,
Vishal

Loading...