Click here to Skip to main content
12,997,469 members (61,592 online)
Click here to Skip to main content


164 bookmarked
Posted 11 Jul 2002

A Complete FTP Server

, 30 May 2005
This article presents a fully functional implementation of a FTP server.
// ApplicationDlg.h : header file


#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "TracePage.h"
#include "OnlineUsersPage.h"
#include "ConfigurationPage.h"
#include "StatisticsPage.h"
#include "UserAccountPage.h"
#include "DialogResize.h"
#include "FTPEventSink.h"
#include "InfobarCtrl.h"

class CApplicationDlg : public CDialogResize, CFTPEventSink
// Construction
	CApplicationDlg(CWnd* pParent = NULL);	// standard constructor
	virtual ~CApplicationDlg();	
	CTracePage m_TracePage;
	CUserAccountPage m_UserAccountPage;
	COnlineUsersPage m_OnlineUsersPage;
	CConfigurationPage m_ConfigurationPage;
	CStatisticsPage m_StatisticsPage;

// Dialog Data
	CInfobarCtrl m_InfobarCtrl;
	CListCtrl	m_OutlookBar;

	// ClassWizard generated virtual function overrides
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
	char* FormatSize(DWORD dwSizeLow, DWORD dwSizeHigh);

	void SetOnlineLed(BOOL bOnline);
	void SetOfflineLed(BOOL bOffline);
	BOOL m_bInitialized;
	HICON m_hIcon;

	void SetupOutlookBar();
	CImageList m_ImageList;

	CToolTipCtrl m_ToolTipCtrl;

	void MoveChilds();
	void ActivatePage(int nIndex);

	BOOL CreateStatusbar();
	CStatusBar m_wndStatusBar;
    CToolBar m_wndToolBar;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnDestroy();
	afx_msg void OnServerStart();
	afx_msg void OnUpdateServerStart(CCmdUI* pCmdUI);
	afx_msg void OnServerStop();
	afx_msg void OnUpdateServerStop(CCmdUI* pCmdUI);
	afx_msg void OnServerExit();
	afx_msg void OnClickOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKeydownOutlookBar(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnViewTrace();
	afx_msg void OnViewOnlineUsers();
	afx_msg void OnViewConfiguration();
	afx_msg void OnUpdateViewTrace(CCmdUI* pCmdUI);
	afx_msg void OnUpdateViewOnlineUsers(CCmdUI* pCmdUI);
	afx_msg void OnUpdateViewConfiguration(CCmdUI* pCmdUI);
	afx_msg void OnHelpAbout();
	afx_msg void OnViewStatistics();
	afx_msg void OnUpdateViewStatistics(CCmdUI* pCmdUI);
	afx_msg void OnViewSecurity();
	afx_msg void OnUpdateViewSecurity(CCmdUI* pCmdUI);
	afx_msg void OnViewUseraccounts();
	afx_msg void OnUpdateViewUseraccounts(CCmdUI* pCmdUI);
	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
	afx_msg void OnHelpGetLatestVersion();
	LRESULT OnKickIdle(WPARAM wParam, LPARAM lParam);
	LRESULT OnFtpStatistic(WPARAM wParam, LPARAM lParam);
    BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
	void OnApply();


	virtual void OnFTPUserConnected(DWORD nThreadID, LPCTSTR lpszUser, LPCSTR lpszAddress);
	virtual void OnFTPUserDisconnected(DWORD nThreadID, LPCTSTR lpszUser);
	virtual void OnFTPStatusChange(int nType, LPCTSTR lpszText);
	virtual void OnFTPReceivedBytesChange(int nBytes);
	virtual void OnFTPSentBytesChange(int nBytes);
	virtual void OnFTPStatisticChange(int nType, int nValue);

// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_APPLICATIONDLG_H__D3E3BA87_EEFA_11D5_AB1C_00D0B70C3D79__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Pablo van der Meer
Web Developer
Netherlands Netherlands
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 30 May 2005
Article Copyright 2002 by Pablo van der Meer
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid