PDA

View Full Version : Mail Notification


Gizmo
13-03-2003, 08:11 AM
Hello,

I'm using EVC++ to create an application and I would like to be informed when a new mail is arrived in the Message Store.

There are some MAPI function to do that (Advise, OnNotify, AdviseSink etc...) but I need some explanations. For example NEWMAIL_NOTIFICATION is not sent by CEMAPI, so how can I know when a new mail is arrived?!!! And first of all, Advise doesn't work. I think I have not allocated the advise sink object. How can I do that?

Thank you for your help or even a sample code for my inspiration!!

Gizmo

JohnSmith
13-03-2003, 09:21 PM
You will never get the notification sink to work since only the process which causes the event will be notified.

I use a special trick: Just open the mail database with CeOpenDatabaseEx(...) and register for DB_* events. Then you will receive an event everytime something in the mail db changes...