2

I have a legacy application that exposes a C++ API to allow you to create plugins that extends its functionalities. In order to create a plugin, you need to create a DLL that implement API functions signatures.

The communication between the legacy app and the plugin is in both ways: the legacy app calls the plugin's DLL and the plugin uses callbacks passed as arguments during it´s initialization to call the legacy app.

To extend the plugin functionality, I need to create a GUI. That's where my questions comes.... The first choice would be using QT, but I´m really trying to avoid it because of my background(I don't like it) and also because the GUI would be not be running in the "main thread", causing some problems.

What I really would like to use is WPF. Is it possible to compile WPF GUI as a class library, call it from DLL C++? (like figure below) Or it is a dumb question?

enter image description here

Obs:

  • I can use both C++ and C++/CLR
guilhermecgs
  • 2,913
  • 11
  • 39
  • 69
  • 2
    Sounds like a very common problem (calling managed code from unmanaged?). Did you try to search for it? WPF stands for UI, it's not UI specific problem (replace wpf with winforms and your question sounds same). [Here](http://www.codeproject.com/Articles/9903/Calling-Managed-Code-from-Unmanaged-Code-and-vice) is something or maybe [here](http://www.windowsdevcenter.com/pub/a/dotnet/2003/03/03/mcppp2.html). If you can use managed c++ in first place, then look [here](http://stackoverflow.com/q/778590/1997232). – Sinatr Aug 13 '15 at 12:21
  • Maybe that's easy and I only lacks expertise, (I spent days researching) but..... 1) How call you compile WPF as class library 2) Start WPF from C++ managed 3) Pass c++ callbacks to c# – guilhermecgs Aug 13 '15 at 12:36
  • Did you try search? [Click](http://stackoverflow.com/q/3573339/1997232), [click](https://support.microsoft.com/en-us/kb/828736), etc. – Sinatr Aug 13 '15 at 12:46
  • AFAIK, the most WPF looking modern API is the one that MS introduced for Metro. Qt now has QML for modern UI. Maybe it makes sense for you to discover QML and see if that works for you. – Alexander V Aug 13 '15 at 22:10
  • Possible duplicate of [Does WPF Work with C++?](http://stackoverflow.com/questions/4776355/does-wpf-work-with-c) – GabrielTK Feb 09 '17 at 22:23

0 Answers0