I'm Using C# WPF.
I have a C++ test dll as follow:
.h:
extern "C" __delspec(dllexport) void TestMethod();
.cpp file:
extern "C"
{
__delspec(dllexport) void TestMethod()
{
MessageBox(0, L"Test", L"Test", MB_ICONINFORMATION);
}
}
C# Code:
[DllImport("DllTest.dll", EntryPoint = "TestMethod")]
public static extern void TestMethod();
And when i'm trying to call to TestMethod i got exception:
an attempt was made to load a program with an incorrect format
What i'm doing wrong?
Thanks!