DELPHI 调用VC DLL 问题?

chinarouter 2004-12-19 02:18:00
在VC DLL 中声明如下:
extern _declspec(dllexport) __stdcall int GetUserInfo(char* SqlText,char* Result);

DELPHI中怎么来调用,是不是声明有错??
...全文
157 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
shilinqun 2005-01-07
  • 打赏
  • 举报
回复
Result:pChar:Result是delphi的保留字。。。写代码时注意一下呀。。。
cdsgajxlp 2005-01-07
  • 打赏
  • 举报
回复
都对
beyondtkl 2005-01-06
  • 打赏
  • 举报
回复
怎麼發這麼多貼?
  • 打赏
  • 举报
回复
type
TGetUserInfo =Function (sqltxt:pChar;Result:pChar):integer;Stdcall;

Callproc();
var
DLLHand:THandle;
ResultStr:String;
GetUserInfo:TGetUserInfo ;
begin
DLLHand := LoadLibrary('DLL.dll');
if DLLHand<>nil then
@GetUserInfo := GetProcAddress(DLLHand,'GetUserInfo');
if @GetUserInfo <> nil then
GetUserInfo('Kao',pchar(ResultStr));
ResultStr:=String(ResultStr); // 好像要转换下才能有
ShowMessage(ResultStr);
end;
  • 打赏
  • 举报
回复
type
GetUserInfo = Function (sqltxt:pChar;Result:pChar):integer;Stdcall;
  • 打赏
  • 举报
回复
type
Function GetUserInfo(sqltxt:pChar;Result:pChar):integer;Stdcall;

Callproc();
var
DLLHand:THandle;
ResultStr:String;
begin
DLLHand := LoadLibrary('DLL.dll');
if DLLHand<>nil then
@GetUserInfo := GetProcAddress(DLLHand,'GetUserInfo');
if @GetUserInfo <> nil then
GetUserInfo('Kao',pchar(ResultStr));
ResultStr:=String(ResultStr); // 好像要转换下才能有
ShowMessage(ResultStr);
end;
chinarouter 2004-12-19
  • 打赏
  • 举报
回复
Function GetUserInfo(sqltxt:pChar;Result:pChar):integer;Stdcall;External 'Dll.dll';

DELPHI中这样写,传不过去参数??为何???
chizengkun 2004-12-19
  • 打赏
  • 举报
回复
好象没错吧,这个也不是太熟,在delphi本身的调用有说明你可以看一下啦

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧