Incorrect format Exception while trying to call C++ dll from C#

后端 未结 1 1980
盖世英雄少女心
盖世英雄少女心 2021-01-22 14:44

I\'m Using C# WPF.
I have a C++ test dll as follow:
.h:

extern \"C\" __delspec(dllexport) void TestMethod();

.cpp file:

相关标签:
1条回答
  • 2021-01-22 15:18

    This seems to be 32bit/ 64 bit problem. Seems like your C++ dll and C# calling assembly are built for different platform targets. Try compiling both for the same platform (either x86 or x64) and then calling the function.

    0 讨论(0)
提交回复
热议问题