Load mfc DLL in C#
I have an mfc dll that I like to load into an C s开发者_StackOverflow中文版harp program!
My source tutorial: http://blogs.msdn.com/b/jonathanswift/archive/2006/10/03/dynamically-calling-an-unmanaged-dll-from-.net-_2800_c_23002900_.aspx
The problem is that he use primitive data types (e.g. int) in the function to load, but I need own types (the class object for getInstance() )!
Is there an easy way to do that?
Thank you, greets leon22
You can't consume C++ classes in a C# project. In fact you can't consume C++ classes in any project compiled with a different compiler, e.g. a different version of MSVC.
Your best approach here is to use COM which is a binary interface standard designed to solve exactly this problem.
精彩评论