leon22
leon22

Reputation: 5639

Load mfc DLL in C#

I have an mfc dll that I like to load into an C sharp 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

Upvotes: 0

Views: 2227

Answers (1)

David Heffernan
David Heffernan

Reputation: 612784

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.

Upvotes: 1

Related Questions