Calling a Delphi DLL from a C# .NET application

前端 未结 4 802
南笙
南笙 2020-12-02 07:46

EDIT: I\'ve posted a better implementation of this, below. I left this here so the responses would make sense.

I\'ve done numerous searches for the

4条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 08:48

    In Delphi 2009 the code works better if you explicitly type variable s as an AnsiString viz:

    var s : Ansistring;
    

    giving the expected result from C# following the call:

    outputInt = 2, outputString = "This is a test 2"
    

    instead of

    outputInt = 2, outputString = "T"
    

提交回复
热议问题