locked
Mapidotnet MessageEvent on console application with wm 6 RRS feed

  • Question

  • Hello,

    I am trying to implement the mapidotnet   MessageEvent On console Application to be notified about new incoming SMS and Email. With:

    …….

    store .MessageEvent += new MessageEventHandler (store_MessageEvent );

    store .EventNotifyMask |= EEventMask .fnevObjectCreated

    Debug .WriteLine (" Event Notify Mask: " + store .EventNotifyMask );

    …..

    public void store_MessageEvent (IMAPIMessageID newMessageID , IMAPIMessageID oldMessageID , EEventMask messageFlags )

      {

    if (messageFlags == EEventMask .fnevObjectCreated )          

      {

    MAPIMessage msg = newMessageID .OpenMessage ();

                    string m = msg .Subject + " at " + msg .LocalDeliveryTime .ToString ()           

    Debug .WriteLine (m );           

    Debug .WriteLine ("in " + newMessageID .ParentFolder .OpenFolder ().DisplayName );              

    Debug .WriteLine ("Message event: " + messageFlags .ToString ());

          }     

       } 

    On windows Form application it’s working without any problem but on console application I’m not getting any notification.

    I try also the Microsoft.WindowsCE.Forms.MessageWindow 
    

    http://msdn.microsoft.com/en-us/library/aa446525.aspx#messagewindow_topic2

    with: protected override void WndProc(ref Message msg)

    To be notified about new message. But it was not working on   console application.

    Any ideas on what I am missing?

    Thanks you for your Help.

     


    Mit freundlichen Gruessen / Best regards / Pozdrawiam A. Chindji Embedded Software Engineer / Ingénieur Logiciel Embarqué
    Wednesday, November 3, 2010 9:20 AM