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
5
  • 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 is something or maybe here. If you can use managed c++ in first place, then look here.
    – Sinatr
    Aug 13, 2015 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# Aug 13, 2015 at 12:36
  • Did you try search? Click, click, etc.
    – Sinatr
    Aug 13, 2015 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. Aug 13, 2015 at 22:10
  • Possible duplicate of Does WPF Work with C++?
    – GabrielTK
    Feb 9, 2017 at 22:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.