I'm exporting a C-style function call with this syntax:
int getDate(char *date);
I'm trying to export to my c# app like this:
[DllImport("C:\\zm7\\Developm\\DLL\\W32.DLL")]
public static extern int getDate(System.IntPtr ptr);
public void getDate()
{
IntPtr ptr = new IntPtr();
string str = "";
getDate(ptr); //// ERROR: Object reference not set to an instance of
an object
str = Marshal.PtrToStringAnsi(ptr);
}
What Am I doing wrong?
Thanks.