📄 oo4o_vcview.cpp
字号:
// OO4O_VCView.cpp : implementation of the COO4O_VCView class
//
#include "stdafx.h"
#include "OO4O_VC.h"
#include "OO4O_VCDoc.h"
#include "OO4O_VCView.h"
#include "DataOpeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView
IMPLEMENT_DYNCREATE(COO4O_VCView, CView)
BEGIN_MESSAGE_MAP(COO4O_VCView, CView)
//{{AFX_MSG_MAP(COO4O_VCView)
ON_COMMAND(IDM_CREATE_TABLE, OnCreateTable)
ON_COMMAND(IDM_INSERT_RECORD, OnInsertRecord)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView construction/destruction
//##ModelId=3F5A8638009D
COO4O_VCView::COO4O_VCView()
{
// TODO: add construction code here
}
//##ModelId=3F5A863800DC
COO4O_VCView::~COO4O_VCView()
{
}
//##ModelId=3F5A863800AE
BOOL COO4O_VCView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView drawing
//##ModelId=3F5A863800AB
void COO4O_VCView::OnDraw(CDC* pDC)
{
COO4O_VCDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView printing
//##ModelId=3F5A863800BB
BOOL COO4O_VCView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
//##ModelId=3F5A863800BE
void COO4O_VCView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
//##ModelId=3F5A863800CE
void COO4O_VCView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView diagnostics
#ifdef _DEBUG
//##ModelId=3F5A863800DE
void COO4O_VCView::AssertValid() const
{
CView::AssertValid();
}
//##ModelId=3F5A863800EA
void COO4O_VCView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
//##ModelId=3F5A8638009E
COO4O_VCDoc* COO4O_VCView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(COO4O_VCDoc)));
return (COO4O_VCDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// COO4O_VCView message handlers
//创建用户表
void COO4O_VCView::OnCreateTable()
{
// TODO: Add your command handler code here
//获取全局对象
COO4O_VCApp * pApp =(COO4O_VCApp *)AfxGetApp();
//实现数据表的创建
CString szSQL;
szSQL.Format("CREATE TABLE %s.TABLE_TEST(\
ID INT,\
NAME VARCHAR2(50),\
MENO VARCHAR2(255))",pApp->m_strUserName);
pApp->oo4o_vc.CreateTable(pApp->m_strUserName,szSQL);
}
void COO4O_VCView::OnInsertRecord()
{
// TODO: Add your command handler code here
CDataOpeDlg dlg;
if(dlg.DoModal()==IDOK)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -