开发者

Load mfc DLL in C#

开发者 https://www.devze.com 2023-03-03 17:50 出处:网络
I have an mfc dll that I like to load into an C s开发者_StackOverflow中文版harp program! My source tutorial:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消