mspocketpc.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IMailSyncCallBack/Pocket Outlook(Messaging)

 
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developers
Author Message
kvh



Joined: 21 Feb 2008
Posts: 1

PostPosted: Wed Feb 20, 2008 10:27 pm    Post subject: IMailSyncCallBack/Pocket Outlook(Messaging) Reply with quote

Platform: Windows Mobile 6
Application: Pocket Outlook (Messaging)
Program Description:
Created an Email Client in my application using Win32 API and MAPI. I'm able
to create and submit my message to Pocket Outlook, but the message resides in
the Outbox until the next synchronization (Send/Receive set @ 5 mins).
However, I need to send the email as soon as possible, and I've read about
COM objects such as IMailSyncCallBack, but I can't find any examples of how
to use this interface properly. A lot of the material that's on the Internet
is very limited, and it's hard to decipher. Maybe I'm confused on the concept
of custom transports (and honestly, I don't want to create one if I don't
have to), but isn't there a way to just use the default transport and
synchronize, without having to provide the implementation details for the
abstract class IMailSyncCallBack? Since MSDN states this as a COM interface,
this is what I've been trying to do, however to no avail:

Code:

CLSID clsid;
LPOLESTR pProgID = L"PocketOutlook.Application"; //Don't think this
is right..
hr = CLSIDFromProgID(pProgID, &clsid);

IMailSyncCallBack *pMSCB;

CoInitializeEx(NULL, COINIT_MULTITHREADED);

//Following Returns E_NOINTERFACE... Therefore, the CLSID is incorrect.
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_HANDLER,
IID_IMailSyncCallBack, (void**) pMSCB);
if(SUCCEEDED(hr))
{
//pMSCB Methods go here
pMSCB->Release();
}
else
{
//Error!
MessageBox(hWnd, _T("Instance Failed!"), _T("Warning!"), MB_OK);
CoUninitialize();
return(-1);
}

Any help would be greatly appreciated.
-kvh
Was this post helpful to you?

Why should I rate a post?



Expand AllCollapse All

Archived from group: microsoft>public>pocketpc>developer
Back to top
View user's profile Send private message
Peter Foot



Joined: 01 Sep 2007
Posts: 56

PostPosted: Thu Feb 21, 2008 1:16 pm    Post subject: Re: IMailSyncCallBack/Pocket Outlook(Messaging) Reply with quote

You can use the MailSyncMessages API to force a Send/Receive (Supported on
Windows Mobile 5.0 and above). See the SDK documentation for full details.

HRESULT r = MailSyncMessages(_T("YourAccount"), MCF_ACCOUNT_IS_NAME);


Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

"kvh" wrote in message @microsoft.com...
> Platform: Windows Mobile 6
> Application: Pocket Outlook (Messaging)
> Program Description:
> Created an Email Client in my application using Win32 API and MAPI. I'm
> able
> to create and submit my message to Pocket Outlook, but the message resides
> in
> the Outbox until the next synchronization (Send/Receive set @ 5 mins).
> However, I need to send the email as soon as possible, and I've read about
> COM objects such as IMailSyncCallBack, but I can't find any examples of
> how
> to use this interface properly. A lot of the material that's on the
> Internet
> is very limited, and it's hard to decipher. Maybe I'm confused on the
> concept
> of custom transports (and honestly, I don't want to create one if I don't
> have to), but isn't there a way to just use the default transport and
> synchronize, without having to provide the implementation details for the
> abstract class IMailSyncCallBack? Since MSDN states this as a COM
> interface,
> this is what I've been trying to do, however to no avail:
>
> Code:
>
> CLSID clsid;
> LPOLESTR pProgID = L"PocketOutlook.Application"; //Don't think
> this
> is right..
> hr = CLSIDFromProgID(pProgID, &clsid);
>
> IMailSyncCallBack *pMSCB;
>
> CoInitializeEx(NULL, COINIT_MULTITHREADED);
>
> //Following Returns E_NOINTERFACE... Therefore, the CLSID is incorrect.
> hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_HANDLER,
> IID_IMailSyncCallBack, (void**) pMSCB);
> if(SUCCEEDED(hr))
> {
> //pMSCB Methods go here
> pMSCB->Release();
> }
> else
> {
> //Error!
> MessageBox(hWnd, _T("Instance Failed!"), _T("Warning!"), MB_OK);
> CoUninitialize();
> return(-1);
> }
>
> Any help would be greatly appreciated.
> -kvh
> Was this post helpful to you?
>
> Why should I rate a post?
>
>
>
> Expand AllCollapse All

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
WM5 Windows Mobile 5 Outlook Messaging Mailto Problem...2003 Hi; I am not a programmer compared to the vast majority of folks here, so please be as conrete as possible, thanks. This has to do with an .htm page that opens in pocket IE. It presents a
with mailto: as the action to submit some survey data. On su

How to open a Pocket Outlook item from Pocket IE Hi, I want to open an item in Pocket Outlook from a webpage in Pocket IE. I know the ID of the item I want to open. It works well on a desktop browser with a link like "outlook:ID". In Pocket IE, I get an error that say "Cannot find 'outlook:ID' (or one o

How to Access Pocket Outlook Categories Hi, I want to get all the categories of Outlook Calendar From the Mobile at once I am using C#.net in my application. I think I get can get categories by IItem - > properties But I am facing two problems while getting all the categories f

How to access Pocket Outlook Categories Hi , I want to access all the categories of pocket outlook. I know the categories can be fatched through POOM but it fetches one by one from appointments Please suggest me any other way to implement this ??

How to get a Pocket Outlook ItemID from an Exchange EntryID Hi, I try to build two applications (one web and one executable) to open items in Pocket Outlook. I already know how to open the items from their Pocket Outlook Item IDs. My data source is on a web server. On the executable application, I get my data from
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group