locked
How to get Notification ? RRS feed

  • Question

  • Hello All,

    I have 2 different project in which I used 1 dll for both...

    Can I get notification from that dll.

    Thanks and Regards,

    DITTU

    Tuesday, June 12, 2012 5:09 AM

Answers

  • Check if you can use Observer Pattern

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    • Marked as answer by DITTU MFC Thursday, June 14, 2012 6:57 AM
    Tuesday, June 12, 2012 7:03 AM
  • Yes. You can basically reference the Rohit's link for Observer pattern. I am just giving you how you can do it.

    1. In your Common.dll, create an event something like MessageReceived

    2. Add a method like OnMessageReceived which invokes the event object

    3. In PRJ1 and PRJ2, just subscribe to the above event.

    Refer the below MSDN pages to know more about event and event handling

    http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx

    http://msdn.microsoft.com/en-us/library/awbftdfh.aspx

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    • Marked as answer by DITTU MFC Thursday, June 14, 2012 6:57 AM
    Tuesday, June 12, 2012 9:35 AM

All replies

  • Check if you can use Observer Pattern

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    • Marked as answer by DITTU MFC Thursday, June 14, 2012 6:57 AM
    Tuesday, June 12, 2012 7:03 AM
  • Yes. You can basically reference the Rohit's link for Observer pattern. I am just giving you how you can do it.

    1. In your Common.dll, create an event something like MessageReceived

    2. Add a method like OnMessageReceived which invokes the event object

    3. In PRJ1 and PRJ2, just subscribe to the above event.

    Refer the below MSDN pages to know more about event and event handling

    http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx

    http://msdn.microsoft.com/en-us/library/awbftdfh.aspx

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    • Marked as answer by DITTU MFC Thursday, June 14, 2012 6:57 AM
    Tuesday, June 12, 2012 9:35 AM