Empty string becomes null when passed from Delphi to C# as a function argument

后端 未结 4 399
南笙
南笙 2021-01-14 14:43

I have a native Delphi exe which calls into C# dll via COM interop. Here\'s the simplest case which demonstrate this issue:

Delphi:

IClass1 = interfa         


        
4条回答
  •  萌比男神i
    2021-01-14 15:16

    To avoid errors by null pointers you can send an empty character with Chr (#0) or AnsiChar(#0) instead of '' that returns a null.

提交回复
热议问题