WINCE实现网络更新程序(转)
2010-01-18 12:45
197 查看
由于工作须要做一个可以通过网络更新应用程序,经研究思考后和结合自身程序的须要,我就弄了一个FTP下载的代码,其实也蛮简单,就是直接去连接FTP,连接后再去下载文件到本地目录,如果文件已存在则自动覆盖(默认),主要代码也参考了网络流行的FTP下载类,头文件如下,如果大家在网上找不到此类的话也可以和我联系索取。
#ifndef _CE_INET_
#define _CE_INET_
#include <wininet.h>
#pragma comment(lib, "wininet.lib")
class CCEInternetSession; // from CObject
class CCEInternetConnection;
class CCEFtpConnection;
class CCEInternetFile; // from CStdioFile (FILETXT.CPP)
class CCEFtpFileFind;
class CCEInternetException;
/////////////////////////////////////////////////////////////////////////////
// Global Functions
bool __stdcall _CEParseURLWorker(LPCTSTR pstrURL,
LPURL_COMPONENTS lpComponents, DWORD& dwServiceType,
INTERNET_PORT& nPort, DWORD dwFlags);
BOOL __stdcall CEParseURL(LPCTSTR pstrURL, DWORD& dwServiceType,
CString& strServer, CString& strObject, INTERNET_PORT& nPort);
BOOL __stdcall CEParseURLEx(LPCTSTR pstrURL, DWORD& dwServiceType,
CString& strServer, CString& strObject, INTERNET_PORT& nPort,
CString& strUsername, CString& strPassword, DWORD dwFlags = 0);
DWORD __stdcall CEGetInternetHandleType(HINTERNET hQuery);
BOOL __stdcall _CEQueryCStringInternetOption(HINTERNET hHandle, DWORD dwOption, CString& refString);
void __stdcall CEThrowInternetException(DWORD dwContext, DWORD dwError = 0);
#define AFX_INET_SERVICE_FTP INTERNET_SERVICE_FTP
#define AFX_INET_SERVICE_HTTP INTERNET_SERVICE_HTTP
#define AFX_INET_SERVICE_GOPHER INTERNET_SERVICE_GOPHER
// these are types that MFC parsing functions understand
#define AFX_INET_SERVICE_UNK 0x1000
#define AFX_INET_SERVICE_FILE (AFX_INET_SERVICE_UNK+1)
#define AFX_INET_SERVICE_MAILTO (AFX_INET_SERVICE_UNK+2)
#define AFX_INET_SERVICE_MID (AFX_INET_SERVICE_UNK+3)
#define AFX_INET_SERVICE_CID (AFX_INET_SERVICE_UNK+4)
#define AFX_INET_SERVICE_NEWS (AFX_INET_SERVICE_UNK+5)
#define AFX_INET_SERVICE_NNTP (AFX_INET_SERVICE_UNK+6)
#define AFX_INET_SERVICE_PROSPERO (AFX_INET_SERVICE_UNK+7)
#define AFX_INET_SERVICE_TELNET (AFX_INET_SERVICE_UNK+8)
#define AFX_INET_SERVICE_WAIS (AFX_INET_SERVICE_UNK+9)
#define AFX_INET_SERVICE_AFS (AFX_INET_SERVICE_UNK+10)
#define AFX_INET_SERVICE_HTTPS (AFX_INET_SERVICE_UNK+11)
class CCEInternetSession : public CObject
{
public:
CCEInternetSession(LPCTSTR pstrAgent = NULL,
DWORD dwContext = 1,
DWORD dwAccessType = PRE_CONFIG_INTERNET_ACCESS,
LPCTSTR pstrProxyName = NULL,
LPCTSTR pstrProxyBypass = NULL,
DWORD dwFlags = 0);
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
CStdioFile* OpenURL(LPCTSTR pstrURL,
DWORD dwContext = 1, DWORD dwFlags = INTERNET_FLAG_TRANSFER_ASCII,
LPCTSTR pstrHeaders = NULL, DWORD dwHeadersLength = 0);
CCEFtpConnection* GetFtpConnection(LPCTSTR pstrServer,
LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
BOOL bPassive = FALSE);
BOOL EnableStatusCallback(BOOL bEnable = TRUE);
DWORD ServiceTypeFromHandle(HINTERNET hQuery);
// operations
DWORD GetContext() const;
operator HINTERNET() const;
virtual void Close();
// overridables
virtual void OnStatusCallback(DWORD dwContext, DWORD dwInternetStatus,
LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
// implementation
DECLARE_DYNAMIC(CCEInternetSession)
~CCEInternetSession();
protected:
DWORD m_dwContext;
HINTERNET m_hSession;
INTERNET_STATUS_CALLBACK m_pOldCallback;
BOOL m_bCallbackEnabled;
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
};
/////////////////////////////////////////////////////////////////////////
//CInternetConnection
class CCEInternetConnection : public CObject
{
public:
CCEInternetConnection(CCEInternetSession* pSession, LPCTSTR pstrServer,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
DWORD dwContext = 1);
// Operations
operator HINTERNET() const;
DWORD GetContext() const;
CCEInternetSession* GetSession() const;
CString GetServerName() const;
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
// Implementation
protected:
HINTERNET m_hConnection;
DWORD m_dwContext;
CCEInternetSession* m_pSession;
virtual void Close();
CString m_strServerName;
INTERNET_PORT m_nPort;
public:
~CCEInternetConnection();
DECLARE_DYNAMIC(CCEInternetConnection)
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
void AssertValid() const;
#endif
};
//////////////////////////////////////////////////////////////////////
class CCEFtpConnection : public CCEInternetConnection
{
public:
CCEFtpConnection(CCEInternetSession* pSession, HINTERNET hConnected,
LPCTSTR pstrServer, DWORD dwContext);
CCEFtpConnection(CCEInternetSession* pSession, LPCTSTR pstrServer,
LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL,
DWORD dwContext = 0,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
BOOL bPassive = FALSE);
BOOL SetCurrentDirectory(LPCTSTR pstrDirName);
BOOL GetCurrentDirectory(CString& strDirName) const;
BOOL GetCurrentDirectory(LPTSTR pstrDirName, LPDWORD lpdwLen) const;
BOOL GetCurrentDirectoryAsURL(LPTSTR pstrName, LPDWORD lpdwLen) const;
BOOL GetCurrentDirectoryAsURL(CString& strDirName) const;
BOOL RemoveDirectory(LPCTSTR pstrDirName);
BOOL CreateDirectory(LPCTSTR pstrDirName);
BOOL Rename(LPCTSTR pstrExisting, LPCTSTR pstrNew);
BOOL Remove(LPCTSTR pstrFileName);
BOOL PutFile(LPCTSTR pstrLocalFile, LPCTSTR pstrRemoteFile,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
BOOL GetFile(LPCTSTR pstrRemoteFile, LPCTSTR pstrLocalFile,
BOOL bFailIfExists = FALSE,
DWORD dwAttributes = FILE_ATTRIBUTE_NORMAL,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
CCEInternetFile* OpenFile(LPCTSTR pstrFileName,
DWORD dwAccess = GENERIC_READ,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
virtual void Close();
// implementation
~CCEFtpConnection();
protected:
CString m_strServerName;
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
DECLARE_DYNAMIC(CCEFtpConnection)
};
//----------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////
// Internet File Access Wrapper
class CCEInternetFile : public CStdioFile
{
// Constructors
protected:
CCEInternetFile(HINTERNET hFile, LPCTSTR pstrFileName,
CCEInternetConnection* pConnection, BOOL bReadMode);
CCEInternetFile(HINTERNET hFile, HINTERNET hSession,
LPCTSTR pstrFileName, LPCTSTR pstrServer, DWORD dwContext,
BOOL bReadMode);
// Attributes
protected:
HINTERNET m_hFile;
public:
operator HINTERNET() const;
DWORD GetContext() const;
// Operations
BOOL SetReadBufferSize(UINT nReadSize);
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
// Overridables
virtual UINT Read(void* lpBuf, UINT nCount);
virtual void Abort();
virtual void Close();
virtual DWORD GetLength() const;
virtual BOOL ReadString(CString& rString);
virtual LPTSTR ReadString(LPTSTR pstr, UINT nMax);
// Not supported by CInternetFile
void LockRange(DWORD dwPos, DWORD dwCount);
void UnlockRange(DWORD dwPos, DWORD dwCount);
CFile* Duplicate() const;
virtual void SetLength(DWORD dwNewLen);
// Implementation
public:
virtual ~CCEInternetFile();
protected:
BOOL m_bReadMode;
DWORD m_dwContext;
HINTERNET m_hConnection;
CString m_strServerName;
UINT m_nWriteBufferSize;
UINT m_nWriteBufferPos;
LPBYTE m_pbWriteBuffer;
UINT m_nReadBufferSize;
UINT m_nReadBufferPos;
LPBYTE m_pbReadBuffer;
UINT m_nReadBufferBytes;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
friend class CCEInternetSession;
friend class CCEFtpConnection;
DECLARE_DYNAMIC(CCEInternetFile)
};
//-----------------------------------------------------------------------
class CCEFtpFileFind : public CObject
{
public:
CCEFtpFileFind(CCEFtpConnection* pConnection, DWORD dwContext = 1);
virtual ~CCEFtpFileFind();
void Close();
virtual BOOL FindFile(LPCTSTR pstrName = NULL,
DWORD dwFlags = INTERNET_FLAG_RELOAD);
virtual BOOL FindNextFile();
CString GetFileURL() const;
CString GetFilePath() const;
CString GetFileName() const;
// implementation
protected:
virtual void CloseContext();
CCEFtpConnection* m_pConnection;
DWORD m_dwContext;
void* m_pFoundInfo;
void* m_pNextInfo;
HANDLE m_hContext;
bool m_bGotLast;
CString m_strRoot;
TCHAR m_chDirSeparator; // not '//' for Internet classes
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
DECLARE_DYNAMIC(CCEFtpFileFind)
};
///////////////////////////////////////////////////////////////////////
// CInternetException
class CCEInternetException : public CException
{
public:
// Constructor
CCEInternetException(DWORD dwError);
// Attributes
DWORD m_dwError;
DWORD m_dwContext;
// Implementation
public:
~CCEInternetException();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
virtual BOOL GetErrorMessage(LPTSTR lpstrError, UINT nMaxError,
PUINT pnHelpContext = NULL);
DECLARE_DYNAMIC(CCEInternetException)
};
#endif
#ifndef _CE_INET_
#define _CE_INET_
#include <wininet.h>
#pragma comment(lib, "wininet.lib")
class CCEInternetSession; // from CObject
class CCEInternetConnection;
class CCEFtpConnection;
class CCEInternetFile; // from CStdioFile (FILETXT.CPP)
class CCEFtpFileFind;
class CCEInternetException;
/////////////////////////////////////////////////////////////////////////////
// Global Functions
bool __stdcall _CEParseURLWorker(LPCTSTR pstrURL,
LPURL_COMPONENTS lpComponents, DWORD& dwServiceType,
INTERNET_PORT& nPort, DWORD dwFlags);
BOOL __stdcall CEParseURL(LPCTSTR pstrURL, DWORD& dwServiceType,
CString& strServer, CString& strObject, INTERNET_PORT& nPort);
BOOL __stdcall CEParseURLEx(LPCTSTR pstrURL, DWORD& dwServiceType,
CString& strServer, CString& strObject, INTERNET_PORT& nPort,
CString& strUsername, CString& strPassword, DWORD dwFlags = 0);
DWORD __stdcall CEGetInternetHandleType(HINTERNET hQuery);
BOOL __stdcall _CEQueryCStringInternetOption(HINTERNET hHandle, DWORD dwOption, CString& refString);
void __stdcall CEThrowInternetException(DWORD dwContext, DWORD dwError = 0);
#define AFX_INET_SERVICE_FTP INTERNET_SERVICE_FTP
#define AFX_INET_SERVICE_HTTP INTERNET_SERVICE_HTTP
#define AFX_INET_SERVICE_GOPHER INTERNET_SERVICE_GOPHER
// these are types that MFC parsing functions understand
#define AFX_INET_SERVICE_UNK 0x1000
#define AFX_INET_SERVICE_FILE (AFX_INET_SERVICE_UNK+1)
#define AFX_INET_SERVICE_MAILTO (AFX_INET_SERVICE_UNK+2)
#define AFX_INET_SERVICE_MID (AFX_INET_SERVICE_UNK+3)
#define AFX_INET_SERVICE_CID (AFX_INET_SERVICE_UNK+4)
#define AFX_INET_SERVICE_NEWS (AFX_INET_SERVICE_UNK+5)
#define AFX_INET_SERVICE_NNTP (AFX_INET_SERVICE_UNK+6)
#define AFX_INET_SERVICE_PROSPERO (AFX_INET_SERVICE_UNK+7)
#define AFX_INET_SERVICE_TELNET (AFX_INET_SERVICE_UNK+8)
#define AFX_INET_SERVICE_WAIS (AFX_INET_SERVICE_UNK+9)
#define AFX_INET_SERVICE_AFS (AFX_INET_SERVICE_UNK+10)
#define AFX_INET_SERVICE_HTTPS (AFX_INET_SERVICE_UNK+11)
class CCEInternetSession : public CObject
{
public:
CCEInternetSession(LPCTSTR pstrAgent = NULL,
DWORD dwContext = 1,
DWORD dwAccessType = PRE_CONFIG_INTERNET_ACCESS,
LPCTSTR pstrProxyName = NULL,
LPCTSTR pstrProxyBypass = NULL,
DWORD dwFlags = 0);
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
CStdioFile* OpenURL(LPCTSTR pstrURL,
DWORD dwContext = 1, DWORD dwFlags = INTERNET_FLAG_TRANSFER_ASCII,
LPCTSTR pstrHeaders = NULL, DWORD dwHeadersLength = 0);
CCEFtpConnection* GetFtpConnection(LPCTSTR pstrServer,
LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
BOOL bPassive = FALSE);
BOOL EnableStatusCallback(BOOL bEnable = TRUE);
DWORD ServiceTypeFromHandle(HINTERNET hQuery);
// operations
DWORD GetContext() const;
operator HINTERNET() const;
virtual void Close();
// overridables
virtual void OnStatusCallback(DWORD dwContext, DWORD dwInternetStatus,
LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
// implementation
DECLARE_DYNAMIC(CCEInternetSession)
~CCEInternetSession();
protected:
DWORD m_dwContext;
HINTERNET m_hSession;
INTERNET_STATUS_CALLBACK m_pOldCallback;
BOOL m_bCallbackEnabled;
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
};
/////////////////////////////////////////////////////////////////////////
//CInternetConnection
class CCEInternetConnection : public CObject
{
public:
CCEInternetConnection(CCEInternetSession* pSession, LPCTSTR pstrServer,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
DWORD dwContext = 1);
// Operations
operator HINTERNET() const;
DWORD GetContext() const;
CCEInternetSession* GetSession() const;
CString GetServerName() const;
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
// Implementation
protected:
HINTERNET m_hConnection;
DWORD m_dwContext;
CCEInternetSession* m_pSession;
virtual void Close();
CString m_strServerName;
INTERNET_PORT m_nPort;
public:
~CCEInternetConnection();
DECLARE_DYNAMIC(CCEInternetConnection)
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
void AssertValid() const;
#endif
};
//////////////////////////////////////////////////////////////////////
class CCEFtpConnection : public CCEInternetConnection
{
public:
CCEFtpConnection(CCEInternetSession* pSession, HINTERNET hConnected,
LPCTSTR pstrServer, DWORD dwContext);
CCEFtpConnection(CCEInternetSession* pSession, LPCTSTR pstrServer,
LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL,
DWORD dwContext = 0,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
BOOL bPassive = FALSE);
BOOL SetCurrentDirectory(LPCTSTR pstrDirName);
BOOL GetCurrentDirectory(CString& strDirName) const;
BOOL GetCurrentDirectory(LPTSTR pstrDirName, LPDWORD lpdwLen) const;
BOOL GetCurrentDirectoryAsURL(LPTSTR pstrName, LPDWORD lpdwLen) const;
BOOL GetCurrentDirectoryAsURL(CString& strDirName) const;
BOOL RemoveDirectory(LPCTSTR pstrDirName);
BOOL CreateDirectory(LPCTSTR pstrDirName);
BOOL Rename(LPCTSTR pstrExisting, LPCTSTR pstrNew);
BOOL Remove(LPCTSTR pstrFileName);
BOOL PutFile(LPCTSTR pstrLocalFile, LPCTSTR pstrRemoteFile,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
BOOL GetFile(LPCTSTR pstrRemoteFile, LPCTSTR pstrLocalFile,
BOOL bFailIfExists = FALSE,
DWORD dwAttributes = FILE_ATTRIBUTE_NORMAL,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
CCEInternetFile* OpenFile(LPCTSTR pstrFileName,
DWORD dwAccess = GENERIC_READ,
DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1);
virtual void Close();
// implementation
~CCEFtpConnection();
protected:
CString m_strServerName;
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
DECLARE_DYNAMIC(CCEFtpConnection)
};
//----------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////
// Internet File Access Wrapper
class CCEInternetFile : public CStdioFile
{
// Constructors
protected:
CCEInternetFile(HINTERNET hFile, LPCTSTR pstrFileName,
CCEInternetConnection* pConnection, BOOL bReadMode);
CCEInternetFile(HINTERNET hFile, HINTERNET hSession,
LPCTSTR pstrFileName, LPCTSTR pstrServer, DWORD dwContext,
BOOL bReadMode);
// Attributes
protected:
HINTERNET m_hFile;
public:
operator HINTERNET() const;
DWORD GetContext() const;
// Operations
BOOL SetReadBufferSize(UINT nReadSize);
BOOL QueryOption(DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufLen) const;
BOOL QueryOption(DWORD dwOption, DWORD& dwValue) const;
BOOL QueryOption(DWORD dwOption, CString& refString) const;
BOOL SetOption(DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength,
DWORD dwFlags = 0);
BOOL SetOption(DWORD dwOption, DWORD dwValue, DWORD dwFlags = 0);
// Overridables
virtual UINT Read(void* lpBuf, UINT nCount);
virtual void Abort();
virtual void Close();
virtual DWORD GetLength() const;
virtual BOOL ReadString(CString& rString);
virtual LPTSTR ReadString(LPTSTR pstr, UINT nMax);
// Not supported by CInternetFile
void LockRange(DWORD dwPos, DWORD dwCount);
void UnlockRange(DWORD dwPos, DWORD dwCount);
CFile* Duplicate() const;
virtual void SetLength(DWORD dwNewLen);
// Implementation
public:
virtual ~CCEInternetFile();
protected:
BOOL m_bReadMode;
DWORD m_dwContext;
HINTERNET m_hConnection;
CString m_strServerName;
UINT m_nWriteBufferSize;
UINT m_nWriteBufferPos;
LPBYTE m_pbWriteBuffer;
UINT m_nReadBufferSize;
UINT m_nReadBufferPos;
LPBYTE m_pbReadBuffer;
UINT m_nReadBufferBytes;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
friend class CCEInternetSession;
friend class CCEFtpConnection;
DECLARE_DYNAMIC(CCEInternetFile)
};
//-----------------------------------------------------------------------
class CCEFtpFileFind : public CObject
{
public:
CCEFtpFileFind(CCEFtpConnection* pConnection, DWORD dwContext = 1);
virtual ~CCEFtpFileFind();
void Close();
virtual BOOL FindFile(LPCTSTR pstrName = NULL,
DWORD dwFlags = INTERNET_FLAG_RELOAD);
virtual BOOL FindNextFile();
CString GetFileURL() const;
CString GetFilePath() const;
CString GetFileName() const;
// implementation
protected:
virtual void CloseContext();
CCEFtpConnection* m_pConnection;
DWORD m_dwContext;
void* m_pFoundInfo;
void* m_pNextInfo;
HANDLE m_hContext;
bool m_bGotLast;
CString m_strRoot;
TCHAR m_chDirSeparator; // not '//' for Internet classes
public:
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
#endif
DECLARE_DYNAMIC(CCEFtpFileFind)
};
///////////////////////////////////////////////////////////////////////
// CInternetException
class CCEInternetException : public CException
{
public:
// Constructor
CCEInternetException(DWORD dwError);
// Attributes
DWORD m_dwError;
DWORD m_dwContext;
// Implementation
public:
~CCEInternetException();
#ifdef _DEBUG
virtual void Dump(CDumpContext& dc) const;
#endif
virtual BOOL GetErrorMessage(LPTSTR lpstrError, UINT nMaxError,
PUINT pnHelpContext = NULL);
DECLARE_DYNAMIC(CCEInternetException)
};
#endif
相关文章推荐
- wince程序实现横屏显示、设备当前电量(C#)
- 网络编程学习笔记二(实现一个基于简单TCP的用户注册程序)
- 使用事件驱动模型实现高效稳定的网络服务器程序
- WinCE的网络驱动实现原理
- python实现类似ftp传输文件的网络程序示例
- 使用事件驱动模型实现高效稳定的网络服务器程序
- 利用Visual Studio制作安装包 / 简单的自动更新程序实现
- java网络编程实现一个聊天程序
- qt实现的五子棋程序,带悔棋和网络对战
- [解决方法]网络策略设置禁止您使用该网站获取您计算机的更新程序。 如果您确认此消息有误,请向您的系统管理员咨询。
- 在海思3512平台实现通过3G网络远程升级程序
- CDMA 无线数据模块网络连接程序的设计与实现
- Lua_ Lua结合BundleManager实现网络热更新_023
- 使用RxAndroid配合MVP模式实现异步网络请求,更新ui
- 网络录音程序的录音部分实现
- linux网络编程:用C语言实现的聊天程序(异步通信)
- wince系统运行中如何实现更新flash中的NK.BIN?持续探讨,欢迎关注
- 使用事件驱动模型实现高效稳定的网络服务器程序
- WinCE的网络驱动实现原理
- 使用事件驱动模型实现高效稳定的网络服务器程序