home *** CD-ROM | disk | FTP | other *** search
- // MFCPDocFast.cpp : implementation file
- //
- // This file is part of Microsoft SQL Server online documentation.
- // Copyright (C) 1992-1997 Microsoft Corporation. All rights reserved.
- //
- // This source code is an intended supplement to the Microsoft SQL
- // Server online references and related electronic documentation.
- #include "stdafx.h"
- #include "MFCPerf.h"
-
- #include "MFCPCust.h"
- #include "DocFast.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocFast
- IMPLEMENT_DYNCREATE(CMFCPDocFast, CDocument)
- BEGIN_MESSAGE_MAP(CMFCPDocFast, CDocument)
- //{{AFX_MSG_MAP(CMFCPDocFast)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- CMFCPDocFast::CMFCPDocFast()
- {
- m_pMFCPCust = NULL;
- }
-
- BOOL CMFCPDocFast::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
-
- if (m_pMFCPCust == NULL)
- {
- m_pMFCPCust = new CMFCPCust(&m_Database);
- CString strConnect = m_pMFCPCust->GetDefaultConnect();
-
- try
- {
- m_Database.Open(NULL, FALSE, FALSE, strConnect, FALSE);
-
- if (!m_Database.IsOpen())
- {
- return (FALSE);
- }
- }
- catch (CException* e)
- {
- e->Delete();
- return (FALSE);
- }
- }
-
- return TRUE;
- }
-
- CMFCPDocFast::~CMFCPDocFast()
- {
- if (m_pMFCPCust != NULL)
- {
- delete m_pMFCPCust;
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocFast diagnostics
- #ifdef _DEBUG
- void CMFCPDocFast::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CMFCPDocFast::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocFast commands
-