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

📄 cedbusedlg.h

📁 EVC编写的WINCE自带数据库的测试程序
💻 H
字号:
// CEDBUseDlg.h : header file
//

#if !defined(AFX_CEDBUSEDLG_H__A7C01499_50EB_41D3_AB46_EF1AF40ED8DC__INCLUDED_)
#define AFX_CEDBUSEDLG_H__A7C01499_50EB_41D3_AB46_EF1AF40ED8DC__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

/////////////////////////////////////////////////////////////////////////////
// CCEDBUseDlg dialog

//定义数据库文件名
const LPTSTR DBFILENAME = _T("\\My Documents\\test.db");
//定义数据库名
const LPTSTR DBTABLENAME = _T("Driver");

//定义驾驶员数据库表结构
typedef struct{
	TCHAR szNo[7];    //驾驶员编号
	TCHAR szName[20];  //驾驶员姓名
	FILETIME ftBrithday;  //驾驶员出生日期
	int iStature;      //驾驶员身高
}REC_DRIVER, *PREC_DRIVER;

//定义驾驶员字段标识
#define PID_NO    MAKELONG(CEVT_LPWSTR, 1)
//定义驾驶员姓名字段标识
#define PID_NAME  MAKELONG(CEVT_LPWSTR, 2)
//定义驾驶员生日字段标识
#define PID_BIRTHDAY MAKELONG(CEVT_FILETIME, 3)
//定义驾驶员身高字段标识
#define PID_STATURE  MAKELONG(CEVT_I4, 4)

class CCEDBUseDlg : public CDialog
{
// Construction
public:
	CCEDBUseDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CCEDBUseDlg)
	enum { IDD = IDD_CEDBUSE_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCEDBUseDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCEDBUseDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnBtnopen();
	afx_msg void OnBtnclose();
	afx_msg void OnBtnrefresh();
	afx_msg void OnBtnadd();
	afx_msg void OnBtnedit();
	afx_msg void OnBtndelete();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	BOOL EditDriver(REC_DRIVER dri, CEOID ceOid);   //编辑驾驶员记录
	BOOL AddNewDriver(REC_DRIVER dri);  //添加一条新记录
	int GetRecordCount(CEGUID *pCeGuid, CEOID ceOid);  //获取数据库的记录数目
	CEOID m_ceOid;    //存储数据库对象标识
	HANDLE m_hDB;     //存储数据库句柄
	CEGUID m_ceGuid;  //存储数据库文件卷标识

};

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CEDBUSEDLG_H__A7C01499_50EB_41D3_AB46_EF1AF40ED8DC__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -