home *** CD-ROM | disk | FTP | other *** search
- // MFCPDocSlow.cpp : implementation of the CMFCPDocSlow class
- //
- // 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 "DocSlow.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocSlow
- IMPLEMENT_DYNCREATE(CMFCPDocSlow, CDocument)
-
- BEGIN_MESSAGE_MAP(CMFCPDocSlow, CDocument)
- //{{AFX_MSG_MAP(CMFCPDocSlow)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocSlow construction/destruction
- CMFCPDocSlow::CMFCPDocSlow()
- {
- m_pMFCPCust = NULL;
- }
-
- CMFCPDocSlow::~CMFCPDocSlow()
- {
- if (m_pMFCPCust != NULL)
- {
- delete m_pMFCPCust;
- }
- }
-
- BOOL CMFCPDocSlow::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;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocSlow diagnostics
- #ifdef _DEBUG
- void CMFCPDocSlow::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CMFCPDocSlow::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMFCPDocSlow commands
-