0
Hello, I’m trying to integrate a dll made in Delphi 10.1 and use its functions in C# however it even accesses the dll but the application CLOSES without giving any error, I will pass as I am doing.
[DllImport("Func.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
public static extern string TestePAnsiChar();
This test function returns me a string "Dll Loaded!"
This function in Delphi :
function TestePAnsiChar: PAnsiChar; stdcall; begin try Result := 'Dll Carregada!'; except on e: exception do Result := PAnsiChar(AnsiString(e.Message)); end; end;
I believe the problem is the type in c# because I changed this function to return an INT and there it is right, just not with this type Pansichar. Thanks in advance.