Lucio Menci

Hi all

Hi downloaded the POOM (if the Windows Mobile 5.0 Pocket PC SDK is it...), and I found the way to accesso to the contact, task and appointment lists, but I haven't found the way to have the access to the folders of the mail lists. It seems that the OutlookSession give me the access only to contacts, tasks and appointments, and the capability to send or create new messages to be save in drafts box...

How can I access to the other boxes There is a different POOM somewhere

Thanks

Lucio



Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Christopher Fairbairn

Hi Lucio

The "Mobile In The Hand" package by In The Hand (http://community.inthehand.com/content/Mobile.aspx) has the required functionality for this. Their APIs which models closely the classes located within the Microsoft.WindowsMobile.PocketOutlook namespace have also extended some of the classes to provide access to obtaining messages stored in message folders such as your inbox etc. The other benifit of the Mobile In The Hand product is support for using these APIs on Pocket PC 2003 devices.

Internally both APIs are wrapping up the MAPI API which is a COM based API which has the required functionality. The following blog entry http://blogs.msdn.com/windowsmobile/archive/2007/03/21/getting-started-with-mapi.aspx contains a brief example of using this API in native C code, if you want to have a go at producing a .NET wrapper yourself but I would suggest it would be easier utilsing a pre-existing wrapper such as the one available from In The Hand.

Hope this helps,

Christopher Fairbairn






Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Lucio Menci

Hi Christopher!

Ehm... About the Mobile In The Hand, I saw that the professional version has the capability I'm looking for. I need those only for myself - I cant sycronyze my phone with outlook, I use them in different ways, but I want to backup or manage my files easily than selecting them one by one... - And I wann't spend 120$!!!

And I'm not able programming in C++, I know much more .NET. And ofthen I used COM for my projects, I can use them easily. But... do you know if I can connect my VB project with the MAPI API via COM I found cemapi.dll in my phone, but in my PC I didn't found any resource, and I cannot copy that dll into my PC (if I try, it says Canc't copy, parametro non corretto)...

Thanks

Lucio





Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Lucio Menci

Hi!

I tried to use cemapi.dll via com, but I didn't foud the definitions of the objects, and the direct access by CreateObject and GetObject are not supported by compact framework. No one knows how I can access to the mapi from .NET via Com

Thanks

Lucio





Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Christopher Fairbairn

Hi Lucio,

The definition for these sorts of COM interfaces are usually located within an Interface Description Language (*.IDL) file within the associated device SDK. However many COM objects available on Windows Mobile devices don't have their associated IDL files included in the SDK.

I bieleve CEMAPI is one such case, where the SDK doesn't include one (atleast with the Pocket PC 2005 SDK). What you would have to do is install the Windows MObile 2005 SDK and look in the C:\program files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Include\Armv4i folder for a file called cemapi.h. This header file is used to access CEMAPI if you are accessing this API in C++ code.

You would then have to have a go at manually translating the various interfaces defined in this file (such as IMAPISession etc) into the equivalent C# code. Notice that this file includes additional header files and most of the interfaces are actually declared in a file called mapix.h

This won't be a trivial exercise, but it is doable given time, but given your statement about not being able to program in C++ it will probably be quiet a difficult exercise.

Sorry I don't have any better news,
Christopher Fairbairn






Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Lucio Menci

Ok, Thank you Christopher, I think it could be usefull.

I can't tel you if I done that exercise until a lot of time. I spend my time for that programs in weekends, and next weekends are so busy for me (I have a show in spain, a medioeval festival, a flag festival and the horse race that fill my free time for over than a month...)

Thank you very much for now,

Lucio





Re: .NET Compact Framework Access to the mail folders of PocketOutlook

Christopher Fairbairn

Hi Lucio,

You may like to also read the following article on MSDN by Alex Feinman - http://msdn2.microsoft.com/en-us/library/aa446515.aspx. Although it is mainly a discussion on how to host ActiveX controls with Compact Framework 2.0 applications you might find the section that starts with the title "Obtaining a COM Interface Definition" valuble, since it is largly what you need to do.

Alex has also done a webcast on this https://www119.livemeeting.com/cc/mseventsbmo/view id=1032278373&pw=F810D48A

Hope it helps,

Christopher Fairbairn