vb 调用 delphi dll的问题
各位高手,谁能指点一下小弟如何在vb中调用delphi dll,我现在主要是在delphi和vb的字符型变量的传递和返回方面很糊涂.
Declare Sub transtringtest2 Lib "project1.dll" (ByVal i As Double, j As String)
procedure transtringtest2(i:real;var j:string);stdcall
begin
if i>0 then j:='大庾岭' else j:='不大庾岭';
end;
上面的例子可以正常运行,但是我如果想用dll中的函数返回字符串时就会有错,如下
Declare Function transtringtest Lib "project1.dll" (ByVal i As Double) As String
function transtringtest(i:real):string;stdcall
begin
if i>0 then result:='大于零' else result:='小于或等于零';
end;
请各位高手能给我指点一下,谢谢!!!