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

Delphi5 dll在Delphi 2009调用出有关问题

2012-02-04 
Delphi5 dll在Delphi 2009调用出问题用Delphi5写的一个内部测试用的DLL如下:function GetID(A:stringB:In

Delphi5 dll在Delphi 2009调用出问题
用Delphi5写的一个内部测试用的DLL如下:

function GetID(A:string;B:Integer;C:Integer): string; stdcall;
export GetID;

如果直接用Delphi5来调用,没问题,但给Delphi2009调用的时候,传入GetID('100',0,0),结果log表明,'100'变成'1'了

改成PChar后问题依然存在,什么原因呢?

[解决办法]
D2009开始字符串默认为Unicode
[解决办法]
Delphi2009调用时修改函数说明为下面形式就应该可以用了:

function GetID(A:AnsiString;B:Integer;C:Integer): AnsiString; stdcall;

热点排行