请问可不可以帮我把下面的C++的.h文件改为delphi的。谢谢。 (10分)

  • 主题发起人 主题发起人 yecloudy
  • 开始时间 开始时间
Y

yecloudy

Unregistered / Unconfirmed
GUEST, unregistred user!
请问可不可以帮我把下面的C++的.h文件改为delphi的。谢谢。
一。
#define WM_FTPLOGIN_RETRY WM_USER+5
#include "winsock.h"
#define REPLY_SIZE 2048
#define DATABUFFER_SIZE 1024



struct TFileInfo
{
TFileInfo()
{
FileName="";
iFileSize=0;
bDir=false;
}
AnsiString FileName;
int iFileSize;
bool bDir;
};

class TFhlFtp
{
private:
SOCKET hCtrlSock;
SOCKET hLstnSock;
SOCKET hDataSock;
AnsiString LstnPort;
AnsiString LocalAddr;
AnsiString Host;
int iPort;
int iID;
HWND Parent;
bool SendCmd(char * sCmd);
int SendCmdAndReply(char * sCmd);
int GetReply();
bool SelectAndWait(SOCKET SelectedSock,int iTimeout);
TFileInfo * ParseFileList(AnsiString FileItem);
public:
TFhlFtp(int AiID,HWND AParent);
~TFhlFtp();
bool Connect(AnsiString AHost,int AiPort);
void __fastcall Disconnect();
bool Login(AnsiString Username,AnsiString & Password);
bool List(AnsiString Path,TList *FileList);

int iTimeout;
};


extern bool g_bTerminatedByUser;
#endif

二。
#ifndef SearchThreadH
#define SearchThreadH

#define WM_FTPSEARCH_COMPLETE WM_USER+1
#define WM_FTPSEARCH_FINDAFILE WM_USER+2
#define WM_FTPSEARCH_STATUSCHANGE WM_USER+3
#define WM_FTPSEARCH_CONNECTED WM_USER+4

#include <Classes.hpp>
#include <syncobjs.hpp>

#include "FhlFtp.h"


struct TFTPSearchInfo
{
AnsiString Host;
int iPort;
AnsiString Username;
AnsiString Password;
AnsiString Path;
AnsiString FileName;
int iFileSize;
bool bDir;
int iID;

TFTPSearchInfo()
{
Host="";
iPort=21;
Username="";
Password="";
Path="";
FileName="";
iFileSize=0;
bDir=false;
iID=0;
}
};

class TFTPSearchThread : public TThread
{
private:
TFhlFtp *FtpClient;

TStringList *BufferList;
TList *FileList;
TStringList *PortList;
TStringList *UsernameList;
TStringList *PasswordList;
TStringList *SearchFileList;
TFTPSearchInfo *FTPSearchInfo;
HWND Parent;


void __fastcall SearchAHost(AnsiString Host);

void __fastcall ScanAllFiles();
protected:
void __fastcall Execute();
public:
__fastcall TFTPSearchThread(bool CreateSuspended);
__fastcall ~TFTPSearchThread();
bool Initialize(TStringList *Port,TStringList *Username,TStringList *Password,
TStringList *SearchFile,int iID,HWND AParent);
};
extern TCriticalSection *CriticalSection;
#endif
 
后退
顶部