C# 调用Delphi 写得com 组件问题?
在delphi中写了这样一个函数,都不能调用成功,望指点。
function TestStr(s:WideString):WideString;stdcall;
begin
result:=s+' -delphi ';
end;
C#中报出的异常
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
[解决办法]
function TestStr(s:pchar):pchar;stdcall;//试试这个
[解决办法]
WideString -> PChar