// ViewerView.cpp : implementation of the CViewerView class // #include "stdafx.h" #include "Viewer.h" #include "ViewerDoc.h" #include "ViewerView.h" #include "MainFrm.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CViewerView IMPLEMENT_DYNCREATE(CViewerView, CHtmlView) BEGIN_MESSAGE_MAP(CViewerView, CHtmlView) // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint) ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1) END_MESSAGE_MAP() // CViewerView construction/destruction CViewerView::CViewerView() { // TODO: add construction code here } CViewerView::~CViewerView() { } BOOL CViewerView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CHtmlView::PreCreateWindow(cs); } void CViewerView::OnInitialUpdate() { CHtmlView::OnInitialUpdate(); Navigate2(_T("http://www.msdn.microsoft.com/visualc/"),NULL,NULL); } // CViewerView printing // CViewerView diagnostics #ifdef _DEBUG void CViewerView::AssertValid() const { CHtmlView::AssertValid(); } void CViewerView::Dump(CDumpContext& dc) const { CHtmlView::Dump(dc); } CViewerDoc* CViewerView::GetDocument() const // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CViewerDoc))); return (CViewerDoc*)m_pDocument; } #endif //_DEBUG // CViewerView message handlers void CViewerView::OnBnClickedButton1() { CMainFrame* pMF = (CMainFrame*)AfxGetMainWnd(); CDialogBar& bar = pMF->GetDialogBarRef(); CString str; bar.GetDlgItemText(IDC_EDIT1,str); Navigate2(str,NULL,NULL); }