For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > May 2005 > Problem with Notification in MAPI SmartPhone 2002









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with Notification in MAPI SmartPhone 2002
Andrey

2005-05-31, 9:11 am

I need to get notification about SMS messages events.
I am using MAPI and IMAPIAdviseSink interface for notification my appl.
I write following code:

void CSmsMonitor::StartMonitor()
{
BOOL err;
ULONG cb;
LPENTRYID lpb;
SRowSet * pSRowSet = NULL;
IMAPITable * pTable = NULL;
ConnectID = 0;
if(MAPIInitialize(NULL) != S_OK) return;
if(MAPILogonEx(0, NULL, NULL, 0, (LPMAPISESSION *)&pSess) != S_OK) return;
if(pSess->GetMsgStoresTable(MAPI_UNICODE, &pTable) != S_OK) return;
if(pTable->QueryRows(1, 0, &pSRowSet) != S_OK) return;
err = pSRowSet->cRows != 1 || pSRowSet->aRow[0].cValues < 1 ||
pSRowSet->aRow[0].lpProps[1].ulPropTag != PR_ENTRYID;
pTable->Release();
if(err == TRUE) return;
cb = pSRowSet->aRow[0].lpProps[1].Value.bin.cb;
lpb = (ENTRYID *)pSRowSet->aRow[0].lpProps[1].Value.bin.lpb;
FreeProws(pSRowSet);
if(pSess->OpenMsgStore(0, cb, lpb, NULL, 0, &pStore) != S_OK) return;
SignalObject = CreateEvent(NULL, FALSE, FALSE, NULL);
if(SignalObject == NULL) return;
OutboxList = new COutboxList(pStore);
if(OutboxList == NULL) return;
hr = pStore->Advise(0, NULL, fnevObjectMoved | fnevObjectCreated |
fnevObjectDeleted, this, &ConnectID);
}

CSmsMonitor is class that implements the IMAPIAdviseSink interface.
This code is a good work on SmartPhone 2003 (EVC4), but it don't give
notification
on SmartPhone 2002 (EVC3). Why is it? I don't get something warnings or
errors, but OnNotify method isn't called.
How can I get a notification from MAPI Storage on SmartPhone 2002?

Thank.

Smartphone 2002/2003
evc++ 3/4

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com