// delphi code (delphi version : Turbo Delphi Explorer (it's Delphi 2006))
function GetLoginResult:PChar;
begin
result:=PChar(LoginResult);
end;
//C# code to use above delphi function (I am using unity3d, within, C#)
[DllImport ("ServerTool")]
private static extern string GetLoginResult(); // this does not work (make crash unity editor)
[DllImport ("ServerTool")]
[MarshalAs(UnmanagedType.LPStr)] private static extern string GetLoginResult(); // this also occur errors
What is right way to use that function in C#?
(for use in also in delphi, code is like, if (event=1) and (tag=10) then writeln('Login result: ',GetLoginResult); )