⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exadocedlg.cpp

📁 wince 下面有关ADOCE方面的库操作code!
💻 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 + -