|
在DELPHI下利用RAPI.DLL成功实现PC与PPC设备的文件传输。
几个主要RAPI函数的DELPHI声明:
function CeRapiInit(): integer; stdcall; external 'RAPI.DLL';
function CeRapiUninit(): integer; stdcall; external 'RAPI.DLL';
function CeCreateFile(lpFileName: WideString; dwDesiredAccess: cardinal; dwShareMode: cardinal; lpSecurityAttributes: pSecurityAttributes;
dwCreationDisposition: cardinal; dwFlagsAndAttributes: cardinal; hTemplateFile: cardinal): cardinal; stdcall; external 'RAPI.DLL';
function CeReadFile(hFile: cardinal; var lpBuffer; nNumberOfBytesToRead: cardinal;
var lpNumberOfBytesRead: cardinal; lpOverlapped: poverlapped): bool; stdcall; external 'RAPI.DLL';
function CeWriteFile(hFile: cardinal; const lpBuffer; nNumberOfBytesToWrite: cardinal;
var lpNumberOfBytesWritten: cardinal; lpOverlapped: poverlapped): bool; stdcall; external 'RAPI.DLL';
function CeCloseHandle(IntPtr: thandle): integer; stdcall; external 'RAPI.DLL';