I know I can use dll import + wrapping (managed) to use C++ libraries in C# applications (question link>>) but what's opposite? How can I use C# library in my C++ application? I'll handle events/operations/results in C# library but my application created with C++. For example here is my C++ application:
//In this example; Manager will be my C# library's instance, Log is a C# library's function that can print something. (That's only an example, not works. For describing something to understand my question)
int main()
{
if(MySystem.Start() == 0) //If there is no error
{
Manager.Log("System started successfully!"); //Post it to C# library!
}
return 0;
}
EDIT: Solution should be native C++. I'll not use C++\CLI!
EDIT: Only c++ application will be native. Namely I can create a shared c++ library to handle C# library. C++ App.(Event) >> C++\CLI Lib. >> C# Library, this way is posibble. Is there any example/topic/start point?
>> MY SOLUTION (After answers, should be helpful for others): I'll create a C++\CLI shared library and I'll use it with my native C++ app. This library will handle my C# library (more about in this question>>). If I don't need C#, I'll re-code my C++\CLI library as native library. I think that is pretty useful.