首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

C# 调用Delphi 写得com 组件有关问题

2012-03-25 
C# 调用Delphi 写得com 组件问题?在delphi中写了这样一个函数,都不能调用成功,望指点。function TestStr(s:

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

热点排行