tags:

views:

28

answers:

1

I have a small WPF application. I wish to integrate it within our exisiting systems. I have two COM servers implemented as MFC MDI apps, lets call them COM_Srv1 and COM_Srv2.

  1. COM_Srv1 needs to call a method of WPF app, say StartTask. On Task Completion WPF app notifies the COM_Srv1 app
  2. WPF app may need to invoke a method on COM_Srv2 to do a certain task. On completion of this task COM_Srv2 notifies WPF app with the result

Both these scenarios are similar (MFC MDI COM server calling WPF app and WPF app calling MFc MDI COM server) but I have listed them.

If it would have been the case of two MFC COM server inter communication then I would have implemented an interface and a COM event source/sink.

But I do not know the optimal way to achieve the interoperation between the WPF app and COM MFC MDI app? I have been thinking about

  1. WCF service as a bridge between the two
  2. Implement a COM end point on both the sides - ie. host a COM component with event/source sink within WPF app etc

I would appreciate if you can help with some specific information on this?

A: 

I have created a COM class within the MFC app with event source. My WPF app connects to this coclass and sinks the events. This way communication from my MFC app to the WPF app is possible. Ensure threading and appartments are implemented correctly in both apps.

byte