Hello! People, tell me, maybe, who faced this.
There is a library in C ++ .lib, there is an API to it, in the form of header files.
There is an example of using the API in C ++
There is a WPF-application on C # in which it is necessary to use this library.
How is this most convenient to do? C ++, unfortunately, I don’t know completely .. :(
The main class from the library to work with (header file):
class ManagerWindows: public Manager { public: static std::shared_ptr<ManagerWindows> getInstance(); };Here is an example of calling this class:
std::shared_ptr<ManagerWindows> manager_; manager_ = ManagerWindows::getInstance();
I do not even know which side to approach ...
Tried to write CLR-vrapper:
//library.h namespace Library { public ref class Wrapper { public: std::shared_ptr<ManagerWindows> getInstance(); }; } //library.cpp std::shared_ptr<ManagerWindows> Library::Wrapper::getInstance() { return ManagerWindows::getInstance(); } When trying to use from C # this compilation error:
Wrapper mw; mw = new Wrapper(); object o = mw.getInstance(); Error CS0570 'Wrapper.getInstance (?)' Is not supported by the language