Communication between DLLs in Metro App RRS feed

  • Question

  • In Win32 application, I could have communications among UI modules (with windows (HWND) handler) by self-defined Message?

    However, in Metro App, HWND is not supported. Is there message loop in Metro App like in Win32 App? or else how should I implement Self-defined message or any other communication method?

    Thanks in advance.

    Thursday, February 2, 2012 7:53 AM

All replies

  • Since the DLLs are all loaded in the same process there are many ways they can communicate. How best will depend on the specific needs of the app. It can pass events, callback functions, etc. as needed.


    Friday, February 3, 2012 3:32 AM
  • Thanks Rob.

    Is there any sample code to introduce events for communication?

    Friday, February 3, 2012 6:58 AM
  • Maybe if we understood your goal, we could provide more specific guidance. Are you looking to port some Win32 code that used the message pump for communicating, or are you looking to understand how one would architect the same type app, but from scratch using the WinRT APIs?


    Win32 event API sample code would be in the Dev Center - Desktop Samples but you would want to be sure you were not using any API's that would prevent your app from passing Store Certification. The forum Quick Start post has some links to the list of Win32 APIs usable in components you provide in your app package.




    Friday, February 3, 2012 11:21 PM
  • So sorry to confuse you. We would like port some Win32 code that used the message pump for communicating.

    In my Win32 code, we uses lots of self-defined messages and communicates through SendMessage or PostMessage. So, in Metro App based on Xaml, is there some way simply like this? Thanks.

    Monday, February 6, 2012 1:45 AM
  • There isn't anything directly analagous to SendMessage or PostMessage or access to a message pump. You will need to use a different means. What will work best will depend on your application so I can't suggest anything specific, but two possibilities would be to wire up WinRT events or to pass classes (instead of HWNDs) and call methods on those.



    Tuesday, February 7, 2012 2:26 AM