Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

MAPI and P/Invoke

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David B. Bitton - 12 Jun 2004 00:48 GMT
I am coding an Outlook 2003 plugin in C#.  It has become apparent that the
only way to get at the data that comprises an email attachment without
saving it to disk first is to use the MAPI.  The call to MAPIInitialize is
no problem and returns with an S_OK.  What I'm not quite sure how to do is
define in C# the IAttach interface (which derives from IMAPIProp and does
not define any methods of its own).

The way I understand it, I should be able to cast the Attachment.MAPIOBJECT
property to IAttach and then call OpenProperty() on the interface.  As you
are aware, MAPI is not a COM object, so Marshal.QueryInterface() won't
(shouldn't) work.  The other thing is the definition if IMAPIProp in
MAPIDefs.h is confusing, and since I'm not an experienced C programmer, I'm
not 100% sure what I'm looking at.

I have looked into using Redemption, but it seems silly to use a COM object
from C# when I could just implement the same code in a managed environment.
www.mapilab.com has some free code for doing just OpenProperty calls, but
it's written as a COM wrapper.  I've looked at the C++ code and it doesn't
seem very complicated; I just don't know how to adapt it to a Managed C++
wrapper from a COM wrapper.

Anyone with some ideas, or know where they can direct me, I would greatly
appreciate it.  Thanks.

Signature

--

David B. Bitton
david@codenoevil.com
www.codenoevil.com

Code Made Fresh DailyT

mapi33dev - 15 Jun 2004 09:54 GMT
Hi David

Try to use mapi33 library.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=C075BF1B-
E83B-401F-91E4-FDDDD194D176


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.