c# - pinvoke c function - System.BadImageFormatException -


im trying call c function c# im getting badimageformatexception.

here c function header:

extern "c" {     __declspec(dllexport) bool validate(char key[]); } 

here how im calling c#

[dllimport("mydll.dll")] static extern bool validate(char[] key); 

whats wrong here.

when calling native methods, should compile c# code 64 or 32 bit explicitely.

 project/properties/build/platform target 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -