Empty string becomes null when passed from Delphi to C# as a function argument
问题 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 = interface(IDispatch) ['{B29BAF13-E9E4-33D7-9C92-FE28416C662D}'] function Test(const aStr: WideString): WideString; safecall; end; var obj: IClass1; s: string; begin obj := CoClass1.Create as IClass1; s := obj.Test(''); // Returns '[null]' end; C#: [ComVisible(true)] public interface IClass1 { string Test(string aStr); } [ComVisible(true)] public class