// 델파이 코드 :C#에서이 델파이 .dll 함수를 호출하는 방법?
function GetLoginResult:PChar;
begin
result:=PChar(LoginResult);
end;
델파이 기능보다 사용하기 // C# 코드 (나는, unity3d 사용하고 내, C 번호) (델파이 버전은 터보 델파이 익스플로러 (이것은 2006 델파이)이다)
[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
C#에서 해당 함수를 사용하는 올바른 방법은 무엇입니까?
(델파이로도 사용할 수 있도록, 코드 등 경우 (이벤트 = 1), (태그 = 10) 그런 경우 Writeln ('로그인 결과 :'GetLoginResult))
도움이 될 수 있습니다. http://stackoverflow.com/questions/5086645/how-to-use-delphi-dllwith-pchar-type-in-c-sharp –