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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -