?? exadocedlg.cpp
字號:
// EXADOCEDlg.cpp : implementation file
//
#include "stdafx.h"
#include "EXADOCE.h"
#include "EXADOCEDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEXADOCEDlg dialog
CEXADOCEDlg::CEXADOCEDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEXADOCEDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CEXADOCEDlg)
m_strDisplay = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CEXADOCEDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEXADOCEDlg)
DDX_Text(pDX, IDC_DISPLAY, m_strDisplay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEXADOCEDlg, CDialog)
//{{AFX_MSG_MAP(CEXADOCEDlg)
ON_BN_CLICKED(IDC_QUERY, OnQuery)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEXADOCEDlg message handlers
BOOL CEXADOCEDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
//Make the Window Wider so the title bar is viewable
if (!SetWindowPos(this,0,0,480,200,SWP_NOZORDER | SWP_NOMOVE)) {
AfxMessageBox(_T("Error Resizing Current Window."));
}
CenterWindow(GetDesktopWindow()); // center to the hpc screen
//Create the ADOModule
m_pADOMod = new ADOModule();
//Initialize the ADOModule
if (FAILED(m_pADOMod->Initialize())) {
AfxMessageBox(_T("Database support cannot be initialized\r\n")
_T("Please make sure that you have the proper database on\r\n")
_T("your device, and that your device supports ADOCE."));
}
return TRUE; // return TRUE unless you set the focus to a control
}
void CEXADOCEDlg::OnQuery()
{
//Show all values in database in display window:
CString strDisplay;
if (!m_pADOMod->DoQuery(strDisplay)) {
AfxMessageBox(_T("Query Failed."));
} else {
m_strDisplay = strDisplay;
UpdateData(FALSE);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -