DllImport Unmanaged, Non .NET Dll to .NET Project Representing Char * and Void __StdCall
I have a DLL non .net and unmanaged written in Borland C++ that I need to import. It returns void and has the identifier __stdcall on the function. It also requires passing of char *. When I try to add it as a reference to my project in VS 2005, it returns an error of not valid assembly. How can I do this in C#? This what I currently have and it does not work: [DllImport ("Project1.dll", CallingConvention=CallingConvention.StdCall)] public static extern IntPtr CustomerForm (String caption); For an unmanaged DLL you do not add it as a reference. Make sure the binary DLL is located in the same