1
Reply

In C#, how to call a dll writed in C++?

Administrator

Administrator

Apr 10 2003 5:47 AM
1.9k
C# call dll method very easy, when the dll source writed in C#. But when a dll is writed in C++, how to call it? I use DllImport to call a function in that dll, but when the application run, throw a exception said that can't found entry point of the function in dll. The function in my ctest.dll like below: int foo { int a; ..... return a; } My C# file to call the function below: [DllImport("ctest.dll",EntyrPoint="foo")] extern static int foo(); ....... int a = foo(); //Application run here throw exception. ....... Who know? Please help me. Thanks.

Answers (1)