📄 ftp1view.cpp
字号:
// FTP1View.cpp : implementation of the CFTP1View class
//
#include "stdafx.h"
#include "FTP1.h"
#include "FTP1Doc.h"
#include "FTP1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFTP1View
IMPLEMENT_DYNCREATE(CFTP1View, CView)
BEGIN_MESSAGE_MAP(CFTP1View, CView)
//{{AFX_MSG_MAP(CFTP1View)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFTP1View construction/destruction
CFTP1View::CFTP1View()
{
m_pInetSession =
new CInternetSession( AfxGetAppName(),
1, PRE_CONFIG_INTERNET_ACCESS );
try{
m_pFtpConnection =
m_pInetSession->GetFtpConnection("ftp.microsoft.com");
}
catch( CInternetException *pEx ){
TCHAR szError[1024];
if( pEx->GetErrorMessage( szError, 1024 ) )
AfxMessageBox( szError );
else
AfxMessageBox( "There was an exception." );
pEx->Delete();
m_pFtpConnection = NULL;
}
}
CFTP1View::~CFTP1View()
{
if( m_pFtpConnection != NULL ){
m_pFtpConnection->Close();
delete m_pFtpConnection;
}
delete m_pInetSession;
}
BOOL CFTP1View::PreCreateWindow(CREATESTRUCT& cs)
{
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CFTP1View drawing
void CFTP1View::OnDraw(CDC* pDC)
{
CFTP1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
/////////////////////////////////////////////////////////////////////////////
// CFTP1View diagnostics
#ifdef _DEBUG
void CFTP1View::AssertValid() const
{
CView::AssertValid();
}
void CFTP1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CFTP1Doc* CFTP1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFTP1Doc)));
return (CFTP1Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFTP1View message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -