?? office.cpp
字號:
// Office.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Office.h"
#include "MainFrm.h"
#include "OfficeDoc.h"
#include "OfficeView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COfficeApp
BEGIN_MESSAGE_MAP(COfficeApp, CWinApp)
//{{AFX_MSG_MAP(COfficeApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// 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
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COfficeApp construction
COfficeApp::COfficeApp()
{
connString=_T("Data Source=Office;UID=sa;PWD=;");
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only COfficeApp object
COfficeApp theApp;
/////////////////////////////////////////////////////////////////////////////
// COfficeApp initialization
BOOL COfficeApp::InitInstance()
{
AfxEnableControlContainer();
AfxOleInit();
HRESULT hRes;
try
{
hRes=m_pConn.CreateInstance(_T("ADODB.Connection"));
m_pConn->ConnectionTimeout = 8;
hRes=m_pConn->Open(_bstr_t((LPCTSTR) connString),
_T(""),_T(""),adModeUnknown);
}
catch(_com_error e)///
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -