| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 689 人关注过本帖
标题:[求助]DELPHI如何調用C寫的DLL文件!
只看楼主 加入收藏
stars_chen
Rank: 1
等 级:新手上路
威 望:1
帖 子:45
专家分:0
注 册:2006-11-15
收藏
 问题点数:0 回复次数:0 
[求助]DELPHI如何調用C寫的DLL文件!

請問各位有知道我應該如何調用這個C寫的DLL文件中的FUNCTION呢?
需要調用:
SMODEM_DLL_API int fnSModem_GetFinderID(char *rfMAC, char *finderID);
SMODEM_DLL_API int fnSModem_Init(char *fname);
SMODEM_DLL_API int fnSModem_Exit();
下面是DLL文件的說明


// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the SMODEM_DLL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// SMODEM_DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
//#ifdef SMODEM_DLL_EXPORTS
#define SMODEM_DLL_API __declspec(dllexport)
//#else
//#define SMODEM_DLL_API __declspec(dllimport)
//#endif
// This class is exported from the SModem_DLL.dll
class SMODEM_DLL_API CSModem_DLL {
public:
CSModem_DLL(void);
// TODO: add your methods here.
};
extern SMODEM_DLL_API int nSModem_DLL;
/*
fname: Filename for logging - like "f:\\logs.txt"
Please note this file is always appended so that there is no data
loss when application restarts. Each new session starts with
system data and time.
This file has to be kept safe by ASUS and sent to Sling Media on
regular basis.
return value:
0: success
-100: file (fname) could not be opened in append mode.
-200: another instance of this DLL might have been
instantiated.
*/
SMODEM_DLL_API int fnSModem_Init(char *fname);
/*
return value:
0: success
-100: not closed properly because of multiple active sessions.
*/
SMODEM_DLL_API int fnSModem_Exit();
/*
rfMAC: NULL terminated string with FinderID - like "0013B6000001".
This should of exactly 12 bytes for "strlen()".
6 byte MAC address needs 12 bytes in string format. 13th byte,
rfMAC[12], should be NULL.

finderID:
16 byte FinderID needs 32 bytes in string format. 33rd byte,
finderID[32], will be NULL.
return value:
0: success
-100: rfMAC is not a 12 byte string.
-200: another instance of this DLL might have been
instantiated.
-300: fnSModem_Init() was unable to open text log file.
*/
SMODEM_DLL_API int fnSModem_GetFinderID(char *rfMAC, char *finderID);

[此贴子已经被作者于2007-6-21 15:30:04编辑过]

搜索更多相关主题的帖子: DELPHI DLL 文件 
2007-06-21 15:28
快速回复:[求助]DELPHI如何調用C寫的DLL文件!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015669 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved