DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: pabinbin
今日帖子: 28
在线用户: 27
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 mengxue (mengxue) ★☆☆☆☆ -
普通会员
2004/2/15 16:51:16
标题:
请教DLL问题? 浏览:1165
加入我的收藏
楼主:      我用DELPHI调用VC++写的DLL,哪个DLL是一个结构类型,例如:
struct SRVCON_API diskperfInfo
{
  char* ipAddress;       //服务器IP地址
  char* accountName;     //服务器登录帐号
  char* accountPwd;      //服务器登录帐号口令
};

SRVCON_API short get_diskperformance(struct diskperfInfo* info);
但是我不知道怎样调用他?请高手指点一二?
----------------------------------------------
-
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2004/2/15 16:56:18
1楼: type
pdiskperfInfo=^diskperfInfo;
diskperfInfo =record
 ipAddress:Pchar;       //服务器IP地址
 accountName:Pchar;     //服务器登录帐号
 accountPwd:Pchar;      //服务器登录帐号口令
end;
SRVCON_API;//不知道是什么?
function get_diskperformance(info:pdiskperfInfo ):smallint;

var
 pdf:pdiskperfInfo;
 i:smallint;
i:=get_diskperformance(pdf);
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 mengxue (mengxue) ★☆☆☆☆ -
普通会员
2004/2/15 17:27:59
2楼: 你全定义的指针类型,如果我还有其他类型呢?比如说:
          long  totalMemory;     
  long  idleMemory;      
  long  useCpu;
我就定义成 
type
pdiskperfInfo=^diskperfInfo;
diskperfInfo =record
 ipAddress:Pchar;       //服务器IP地址
 accountName:Pchar;     //服务器登录帐号
 accountPwd:Pchar;      //服务器登录帐号口令
totalMemory:longint;
idleMemory:longint;
useCpu:longint;
end;
    对吗?
----------------------------------------------
-
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2004/2/15 17:32:55
3楼: yes
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 mengxue (mengxue) ★☆☆☆☆ -
普通会员
2004/2/16 9:10:29
4楼: function get_diskperformance(info:pdiskperfInfo ):smallint;这一句是不还要加上:
function get_diskperformance(info:pdiskperfInfo ):smallint;external 'srvcon.dll';要不要这样啊?  stdcall external 'srvcon.dll',要stdcall,有什么作用啊?
----------------------------------------------
-
作者:
男 sephil (NAILY Soft) ★☆☆☆☆ -
盒子中级会员
2004/2/16 15:09:45
5楼: 标准调用方式
----------------------------------------------
Copyright 2008 ? NAILY Soft

Click here to redirect to my home
Click here to redirect to my blog
作者:
男 mengxue (mengxue) ★☆☆☆☆ -
普通会员
2004/2/16 15:46:20
6楼:  sephil :我现在要具体的调用了,我认为我要先传个参数过去,所以我这样来做
var
  AperfInfo:pperfInfo;
  FperfInfo:perfInfo;
begin
  AperfInfo.ipAddress:=PChar('10.130.110.18');其他的参数都为空,
然后呢,我开始调用了:get_performance(aperfInfo);
然后我想取出我要的信息,但取不出来
我想啊listview1.items.caption:=aperfinfo.ipaddress;
      listview1.items.subitems.add(aperfindo.accountName);
      等等,
但是我取不出来。还有我,我定义的是指针类型,但我把他转换成字符类型,我不知道怎么转换?请指教

----------------------------------------------
-
作者:
男 mengxue (mengxue) ★☆☆☆☆ -
普通会员
2004/2/16 16:07:10
7楼: 我上面的问题解决了,谢谢,不过为什么不加我的QQ啊?
----------------------------------------------
-
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2004/2/16 16:57:46
8楼: 呵呵怎么解决的,偶的QQ上已经有大哥你了呀!
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行58.59375毫秒 RSS