adomodule.h

来自「This code will be useful to you if you h」· C头文件 代码 · 共 54 行

H
54
字号
#ifndef _ADOMODULE_H
#define _ADOMODULE_H

//Include all the definitions of the COM objects that we need.
//This file was included with the ADOCE SDK.
#include "adoce.h"

//Needed for the COleVariant type
#include <afxdisp.h>

class ADOModule {
public:
	//Creates the module - must call initialize before using.
	ADOModule();

	//Shuts down the COM resources.
	~ADOModule();

	//CoInitializes and loads the COM resources.
	//If an error occurs here, the class is unusable.
	HRESULT				Initialize();

	//Tells whether it's safe to call getRecordSet
	BOOL				isInitialized() 
	{return (m_bInit == TRUE);}

	//Tells if the CE device is Compatible (i.e. has the proper
	//Database files and tables within the database);
	//If incoming parameter is TRUE, it will show a dialog box
	//with the results - and a record count of the tables.
	BOOL				VerifyCompatible(BOOL bShow = FALSE);

	//Fills in the String with a formatted query result
	BOOL				DoQuery(CString& strResult);


	//Return interface pointers
	IADOCEFields*		getFields()
	{return ( UpdateFields()?m_pIFields   :NULL);}

	IADOCERecordset*	getRecordSet() 
	{return (isInitialized()?m_pIRecordSet:NULL);}

private:
	//Methods
	BOOL				UpdateFields();

	//Member variables
	BOOL				m_bInit;
	CString				m_strFilePath;
	IADOCEFields*		m_pIFields;
	IADOCERecordset*	m_pIRecordSet;
};
#endif

⌨️ 快捷键说明

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