Re: detect "changed" contacts using POOM

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: mazza (mazza_at_net)
Date: 08/13/04


Date: Fri, 13 Aug 2004 16:45:04 +0100

I am writing a code to read all messages using MAPI.
But I haven't understood MAPI yet.....
The maximum rows of QueryRows is 10 rows.
How can i read more than 10 messages ?

Sorry many questions..

Here is my code:
 ULONG numberOfMessages;
 lpTable->GetRowCount(0,&numberOfMessages); // The number of messages;
 hRes = lpTable->SetColumns( (LPSPropTagArray)&sContents, 0 );
 hRes = lpTable->QueryRows( numberOfMessages, 0, &pRows ); <-------
problem
 lpTable->Release();

 for(int k=0;k<numberOfMessages;k++){

  hRes = pMsgStore->OpenEntry( pRows->aRow[k].lpProps[0].Value.bin.cb,
(LPENTRYID)pRows->aRow[k].lpProps[0].Value.bin.lpb, NULL, 0, &ulObjType,
(LPUNKNOWN FAR *)&lpMessage);

  SizedSPropTagArray(1,rgTags_SENDER) = {1,PR_SENDER_NAME};
  hRes = lpMessage->GetProps((LPSPropTagArray) &rgTags_SENDER, MAPI_UNICODE,
&pcount, &rgprops);
  senderID=space->textTostr(rgprops->Value.lpszW);

  SizedSPropTagArray(1,rgTags_SUBJECT) = {1,PR_SUBJECT};
  hRes = lpMessage->GetProps((LPSPropTagArray) &rgTags_SUBJECT,
MAPI_UNICODE, &pcount, &rgprops);
  subject=space->textTostr(rgprops->Value.lpszW);

  add(new SmsMessage( ... ));

 }

"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:%23P7sBUjfEHA.2896@TK2MSFTNGP11.phx.gbl...
> You are passing 0 as the last parameter into CeOpenDatabaseEx2 - this
needs
> to be a pointer to a CENOTIFYREQUEST structure which contains the window
> handle which is to receive notifications.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com
>
> Do have an opinion on the effectiveness of Microsoft Windows Mobile and
> Embedded newsgroups? Let us know!
> https://www.windowsembeddedeval.com/community/newsgroups
>
> "mazza" <mazza@net> wrote in message
> news:%23%23abUeifEHA.2028@tk2msftngp13.phx.gbl...
> >I would like to detect when a contact is deleted or added.
> > When a contact is deleted or added, WM_DBNOTIFICATION happens , doesn't
> > it?
> > But I can't catch any event.
> >
> > Any idea?
> >
> > Here is my code:
> > CEOID ceDB;
> > CEDBASEINFO ceDBInfo;
> > HANDLE g_hDbContacts = INVALID_HANDLE_VALUE;
> > g_guidDB = (PCEGUID) LocalAlloc (LPTR, sizeof (CEGUID));
> > CREATE_INVALIDGUID(g_guidDB);
> >
> > g_hDbContacts = CeOpenDatabaseEx2(g_guidDB, &ceDB, _T("Contacts
> > Database"),
> > 0,CEDB_AUTOINCREMENT, 0);
> >
> > LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
> > lParam)
> > {
> >
> > ...
> >
> > switch (message)
> > {
> > case WM_DBNOTIFICATION:
> >
> > case DB_CEOID_CREATED:
> >
> > case DB_CEOID_DATABASE_DELETED:
> >
> > }
> > }
> >
> > Thanks,
> >
> >
>
>



Relevant Pages

  • Re: detect "changed" contacts using POOM
    ... > I am writing a code to read all messages using MAPI. ... > The maximum rows of QueryRows is 10 rows. ... >> Windows Embedded MVP ...
    (microsoft.public.pocketpc.developer)
  • Re: How to send a mail from app, without blocking APP!?
    ... I have my own cMAPI class now, that incorporates MAPI API, ... still I can't make it work without APP MODAL, it seams to me that UIParam argument in all functions has to be pointer to CWnd class ... I don't want to loose more time on this - now it seams to me like impossible task, I can bet that MS support would say "It is by ... MAPI is no longer part of Windows as of Windows ...
    (microsoft.public.vb.winapi)
  • Re: Mapi - Fehler
    ... unter Windows 2000 A00/XP und WinXp A00/XP funktioniert. ... Dieser kommt in der Standard Mapi nicht vor. ... Die gleichen Befehle verwenden IIRC auch die Collaboratiion Data Objects (CDO Version 1.2). ... CDO for Windows 2000 Library, MS CDO 1.21 Library oder eine andere MAPI Library? ...
    (microsoft.public.de.access)
  • Re: How to send a mail from app, without blocking APP!?
    ... Microsoft CDO for Windows 2000 Library "CDOSYS.DLL" ... All articles in MSDN are releated to the CDO.DLL (MAPI) not CDOSYS.DLL ro I must be blind. ... But when you use OE to compose message OE Compose window doen't block OE Main window, ... as it does block my app (all windows) when I use MAPI for composing a mail. ...
    (microsoft.public.vb.winapi)
  • Re: how to capture appointment/task/new mail arrival events?
    ... Firstly there are two different subsystems - POOM for working with Appointments, Tasks and Contacts and MAPI for working with Email and SMS. ... In WM5.0 and above POOM has support for Windows Message notifications on item creation, ... How to do it in Windows Mobile 6? ...
    (microsoft.public.pocketpc.developer)