在delphi 里如何同化 bcb 写的dll的头文件,请高手指点!谢谢! (50分)

  • 主题发起人 主题发起人 decade
  • 开始时间 开始时间
D

decade

Unregistered / Unconfirmed
GUEST, unregistred user!
一个由C++BUILDER 写的DLL的头文件包含以下代码,请问里面的函数输出在delphi如何翻译处理
,要不要翻译?
#ifdef __cplusplus
extern "C" {
#endif

struct MainController // M2 System Controller
{
public:
virtual ~MainController(){};

//---------------------------------------------------------------
// Hardware Control API
virtual DWORD WINAPI OpenDevice(char* port, DWORD speed) = 0;
virtual DWORD WINAPI CloseDevice() = 0;
virtual DWORD WINAPI GetDeviceInfo(DeviceInfoParam* pDeviceInfo) = 0;
virtual DWORD WINAPI Configure() = 0;
virtual DWORD WINAPI SetBrightness(DWORD brightness) = 0;
virtual DWORD WINAPI ExpAutoTunning(DWORD* brightness) = 0;
virtual DWORD WINAPI SetTime(TimeRecord* pTimeRecord) = 0;
virtual DWORD WINAPI GetTime(TimeRecord* pTimeRecord) = 0;
virtual DWORD WINAPI SetSystemParam(DWORD selector, void* param) = 0;
virtual DWORD WINAPI GetSystemParam(DWORD selector, void* param) = 0;

//---------------------------------------------------------------
// Commnucation API
virtual DWORD WINAPI SendCommand(DWORD cmd, DWORD* param1, DWORD* param2) = 0;
virtual DWORD WINAPI SendData(DWORD len, void* data) = 0;
virtual DWORD WINAPI ReadData(DWORD len, void* data) = 0;

//---------------------------------------------------------------
// Fingerprint Verify/Enroll API
virtual DWORD WINAPI GetImage(BYTE* imgBuf, DWORD zoom) = 0;
virtual DWORD WINAPI GetMinutiae(BYTE* fetBuf) = 0;
virtual DWORD WINAPI EnrollUser(const char* userID, bool master) = 0;
virtual DWORD WINAPI ChangeFingerprint(const char* userID) = 0;
virtual DWORD WINAPI DeleteUser(const char* userID) = 0;
virtual DWORD WINAPI VerifyUser(const char* userID) = 0;
virtual DWORD WINAPI IdentifyUser(char* userID) = 0;
virtual DWORD WINAPI VerifyMaster() = 0;

//---------------------------------------------------------------
// Database management Related API
virtual DWORD WINAPI DBGetRecordCount(DWORD* recCount) = 0;
virtual DWORD WINAPI DBGetRecord(const char* userID, UserRecord* pUserRecord) = 0;
virtual DWORD WINAPI DBGetFirstRecord(UserRecord* pUserRecord) = 0;
virtual DWORD WINAPI DBGetNextRecord(UserRecord* pUserRecord) = 0;
virtual DWORD WINAPI DBDeleteAllRecord() = 0;
virtual DWORD WINAPI DBGetCurrentRecord(UserRecord* pUserRecord) = 0;

virtual DWORD WINAPI DBAddRecord(UserRecord* pUserRecord) = 0;
virtual DWORD WINAPI DBDeleteRecord(const char* userID) = 0;

//---------------------------------------------------------------
// DB Utility Function
virtual DWORD WINAPI DBGetMasterCount(DWORD* masterCount) = 0;
virtual DWORD WINAPI DBGetUserIDList(UINT16* pIDList) = 0;
virtual DWORD WINAPI DBGetMasterIDList(UINT16* pMasterIDList) = 0;

//---------------------------------------------------------------
// Log Information Related API
virtual DWORD WINAPI DBGetLogCount(DWORD* logCount) = 0;
virtual DWORD WINAPI DBGetLogData(DWORD recNo, LogRecord* pLogRecord) = 0;
virtual DWORD WINAPI DBDeleteAllLog() = 0;

//---------------------------------------------------------------
// Utility fuction
virtual DWORD WINAPI RecoverMasterRec(void) = 0;
};

typedef MainController FAR* LPESC;
typedef DWORD (WINAPI* MainController_CreateFunc)(LPESC* ppESC);
typedef DWORD (WINAPI* MainController_DestroyFunc)(LPESC pESC);

//******************* 以下部分在delphi里如何翻译处理××××××××××
//**************************************************************************


__declspec(dllexport) DWORD WINAPI CreateControllerObject(LPESC* ppESC = NULL);
__declspec(dllexport) DWORD WINAPI DestroyControllerObject(LPESC pESC = NULL);

//---------------------------------------------------------------
// Hardware Control API
__declspec(dllexport) DWORD WINAPI M2InitLibray(void* createParam);
__declspec(dllexport) DWORD WINAPI M2ExitLibrary(void* createParam);
__declspec(dllexport) DWORD WINAPI M2OpenDevice(char* port, DWORD speed);
__declspec(dllexport) DWORD WINAPI M2CloseDevice();
__declspec(dllexport) DWORD WINAPI M2GetDeviceInfo(DeviceInfoParam* pDeviceInfo);
__declspec(dllexport) DWORD WINAPI M2Configure();
__declspec(dllexport) DWORD WINAPI M2SetBrightness(DWORD brightness);
__declspec(dllexport) DWORD WINAPI M2ExpAutoTunning(DWORD* brightness);
__declspec(dllexport) DWORD WINAPI M2SetTime(TimeRecord* pTimeRecord);
__declspec(dllexport) DWORD WINAPI M2GetTime(TimeRecord* pTimeRecord);
__declspec(dllexport) DWORD WINAPI M2SetSystemParam(DWORD selector, void* param);
__declspec(dllexport) DWORD WINAPI M2GetSystemParam(DWORD selector, void* param);

//---------------------------------------------------------------
// Commnucation API
__declspec(dllexport) DWORD WINAPI M2SendCommand(DWORD cmd, DWORD* param1, DWORD* param2);
__declspec(dllexport) DWORD WINAPI M2SendData(DWORD len, void* data);
__declspec(dllexport) DWORD WINAPI M2ReadData(DWORD len, void* data);

//---------------------------------------------------------------
// Fingerprint Verify/Enroll API
__declspec(dllexport) DWORD WINAPI M2GetImage(BYTE* imgBuf, DWORD zoom);
__declspec(dllexport) DWORD WINAPI M2GetMinutiae(BYTE* fetBuf);
__declspec(dllexport) DWORD WINAPI M2EnrollUser(const char* userID, bool master);
__declspec(dllexport) DWORD WINAPI M2ChangeFingerprint(const char* userID);
__declspec(dllexport) DWORD WINAPI M2DeleteUser(const char* userID);
__declspec(dllexport) DWORD WINAPI M2VerifyUser(const char* userID);
__declspec(dllexport) DWORD WINAPI M2IdentifyUser(char* userID);
__declspec(dllexport) DWORD WINAPI M2VerifyMaster();

//---------------------------------------------------------------
// Database management Related API
__declspec(dllexport) DWORD WINAPI M2DBGetRecordCount(DWORD* recCount);
__declspec(dllexport) DWORD WINAPI M2DBGetRecord(const char* userID, UserRecord* pUserRecord);
__declspec(dllexport) DWORD WINAPI M2DBGetFirstRecord(UserRecord* pUserRecord);
__declspec(dllexport) DWORD WINAPI M2DBGetNextRecord(UserRecord* pUserRecord);
__declspec(dllexport) DWORD WINAPI M2DBDeleteAllRecord();
__declspec(dllexport) DWORD WINAPI M2DBGetCurrentRecord(UserRecord* pUserRecord);

__declspec(dllexport) DWORD WINAPI M2DBAddRecord(UserRecord* pUserRecord);
__declspec(dllexport) DWORD WINAPI M2DBDeleteRecord(const char* userID);

//---------------------------------------------------------------
// DB Utility Function
__declspec(dllexport) DWORD WINAPI M2DBGetMasterCount(DWORD* masterCount);
__declspec(dllexport) DWORD WINAPI M2DBGetUserIDList(UINT16* pIDList);
__declspec(dllexport) DWORD WINAPI M2DBGetMasterIDList(UINT16* pMasterIDList);

//---------------------------------------------------------------
// Log Information Related API
__declspec(dllexport) DWORD WINAPI M2DBGetLogCount(DWORD* logCount);
__declspec(dllexport) DWORD WINAPI M2DBGetLogData(DWORD recNo, LogRecord* pLogRecord);
__declspec(dllexport) DWORD WINAPI M2DBDeleteAllLog();

//---------------------------------------------------------------
// Utility fuction
__declspec(dllexport) DWORD WINAPI M2RecoverMasterRec(void);


#ifdef __cplusplus
}
#endif
 
送分,不知为何删除不了问题.
 
后退
顶部