interop mapi32.dll

M

Miguel Jimenez

Hi,

I'm trying to perfom a p/invoke call to the hrgetoneprop
function of mapi32.dll from c# but i get a
System.NullReferenceException when performing the call ..

The code is:

Outlook.Application applicationObject = new
Outlook.ApplicationClass();
Outlook.NameSpace outlookNS =
applicationObject.GetNamespace("MAPI");
Outlook.MAPIFolder inboxFolder =
outlookNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox);

Outlook.MailItem mailItem = (Outlook.MailItem)
inboxFolder.Items.GetFirst();

IntPtr result = IntPtr.Zero;
uint headers = 0x007D001E;
HrGetOneProp((object)mailItem.MAPIOBJECT, headers, ref
result);


Has any pinvoke guru help me with the need conversions to
perform this call??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top