VC6的代码如何转成DELPHI的?在线等!(100)

  • 主题发起人 主题发起人 kissfire5560
  • 开始时间 开始时间
K

kissfire5560

Unregistered / Unconfirmed
GUEST, unregistred user!
#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000#include <Dbt.h>// Definition for dwDesireAccess#define IVD_OPEN_READ 1#define IVD_OPEN_WRITE 2// Definition for dwCreationDisposition#define IVD_CREATE_NEW 0#define IVD_OPEN_EXISTING 1#define IVD_OPEN_ALWAYS 2#define IVD_OVERWRITENEW 0x10#define IVD_TRUNCATE_EXISTING 0x20// Definition for VerifyPIN#define IVD_ACT_USER 0#define IVD_ACT_UNBLOCK 1#define IVD_ACT_ADMIN 2#define IVD_ACT_PIN_EN 3#define IVD_ACT_PIN_DIS 4typedef struct tagFileInfo{ TCHAR szFolder[MAX_PATH]; TCHAR szFileName[MAX_PATH]; LARGE_INTEGER liFileSize; LARGE_INTEGER liCurrentPointer;} IVD_FILEINFORMATION, *PIVD_FILEINFORMATION;#define ATTR_FILE 0x08#define ATTR_DIRECTORY 0x10typedef struct tagVolumeInfo{ DWORD dwFreeCluster; DWORD dwAllCluster; BYTE bySerialNum[16]; LPCTSTR pwcsLable; USHORT usClusterSize; BYTE AuthenState;} IVD_VOLUMEINFO, *PIVD_VOLUMEINFO;typedef struct tagFolderSecurityDesc{ BYTE ViewedLevel: 4; // For file entry BYTE AuthMethodForOnce: 4; BYTE ReadLevel: 4; // For Directory Mark BYTE AppendLevel: 4; BYTE WriteLevel: 4; BYTE CreateLevel: 4; BYTE ReadLevelHi: 4; BYTE Redefine: 4;} IVD_FOLDER_SECURITYDESC, *PIVD_FOLDER_SECURITYDESC;typedef BYTE (CALLBACK * PFCOPYPROGRESS_CALLBACK) (BYTE ulReason, LPCTSTR pszCurFile, LPVOID pdwValue);typedef struct tagCopyCondition{ BOOL blKeepSlient; BOOL blStopWhenError; BOOL blOverWriteSameFile; PFCOPYPROGRESS_CALLBACK pfCallBack;} IVD_OP_CONDITION, *PIVD_OP_CONDITION;#define IVD_REASON_NO_ERROR 0#define IVD_REASON_SOURCEFILE_CANT_OPEN 1#define IVD_REASON_SOURCEFILE_READ_ERROR 2#define IVD_REASON_TARGETFILE_EXISTED 3#define IVD_REASON_TARGETDIR_EXISTED 4#define IVD_REASON_TARGETFILE_CANT_OPEN 5#define IVD_REASON_TARGETFILE_WRITEERROR 6#define IVD_REASON_DISK_FULL 7#define IVD_REASON_FILE_OPENED 8#define IVD_REASON_FINISHED 10#define IVD_ANSWER_CONTINUE 0#define IVD_ANSWER_CONTINUE_ALWAYS 1#define IVD_ANSWER_SKIP_THIS_ERROR 2#define IVD_ANSWER_STOP 3DWORD WINAPI IVD_CloseIVD(void);
 
太长了,看不懂,只要对上面的意思和流程理解了,再用Delphi改也可以.
 
一点提示:#define用const代替比如 #define IVD_REASON_NO_ERROR 0 => const IVD_REASON_NO_ERROR = 0;结构用记录代替比如:typedef struct tagFileInfo{ TCHAR szFolder[MAX_PATH]; TCHAR szFileName[MAX_PATH]; LARGE_INTEGER liFileSize; LARGE_INTEGER liCurrentPointer;} IVD_FILEINFORMATION, *PIVD_FILEINFORMATION;type PIVD_FILEINFORMATION = ^IVD_FILEINFORMATION; IVD_FILEINFORMATION = record szFolder : array[0..MAX_PATH-1] of char; szFileName: array[0..MAX_PATH-1] of char; liFileSize : LARGE_INTEGER; liCurrentPointer: LARGE_INTEGER;end;
 
typedef BYTE (CALLBACK * PFCOPYPROGRESS_CALLBACK) (BYTE ulReason, LPCTSTR pszCurFile, LPVOID pdwValue);typePFCOPYPROGRESS_CALLBACK=function(ulReason:BYTE ;pszCurFile:LPCTSTR ; pdwValue LPVOID):byte;stdcall;CALLBACK函数默认为stdcallLPCTSTR ,LPVOID在windiws单元有定义,没有转几个月忘记了
 

Similar threads

后退
顶部