I am trying to pass a string from C # to a Delphi built DLL. Delphi DLL expects PChar.
Here is the Delphi export
procedure DLL_Message(Location:PChar;AIntValue :integer);stdcall; external 'DLLTest.dll';
C # import (the last one I tried was a string, char * ref string ...)
[DllImport( "DLLTest.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "DLL_Message" )] public static extern void DLL_Message(IntPtr Location, int AIntValue);
I am accessing an access violation value in any way.
Is there any solution to pass string value as PChar in C #?
source share