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

📄 simplepointcursorhelper.h

📁 COM编程接口处理方法 多个方法调用COM库函数
💻 H
字号:
// SimplePointCursorHelper.h : Declaration of the CSimplePointCursorHelper

#ifndef __SIMPLEPOINTCURSORHELPER_H_
#define __SIMPLEPOINTCURSORHELPER_H_

#include "resource.h"       // main symbols
#include <iostream>
#include <fstream>
using namespace std;

const int c_iMaxRowLen = 80;

/////////////////////////////////////////////////////////////////////////////
// CSimplePointCursorHelper
class ATL_NO_VTABLE CSimplePointCursorHelper : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CSimplePointCursorHelper, &CLSID_SimplePointCursorHelper>,
	public ISupportErrorInfo,
	public IPlugInCursorHelper,
	public IPlugInFastQueryValues,
	public ISimplePointCursorHelper
{
public:
	CSimplePointCursorHelper()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_SIMPLEPOINTCURSORHELPER)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CSimplePointCursorHelper)
	COM_INTERFACE_ENTRY(ISimplePointCursorHelper)
	COM_INTERFACE_ENTRY(IPlugInCursorHelper)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY(IPlugInFastQueryValues)
END_COM_MAP()

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// IPlugInCursorHelper
  STDMETHOD(NextRecord)();
  STDMETHOD(IsFinished)(VARIANT_BOOL *finished);
  STDMETHOD(QueryValues)(IRowBuffer *Row, long *OID);
  STDMETHOD(QueryShape)(IGeometry *pGeometry);

// IPlugInFastQueryValues
	STDMETHOD(FastQueryValues)(LONG * Values);

// ISimplePointCursorHelper
	STDMETHOD(put_FilePath)(BSTR newVal);
	STDMETHOD(put_FieldMap)(VARIANT fieldMap);
	STDMETHOD(put_OID)(long lOID);
	STDMETHOD(putref_QueryEnvelope)(IEnvelope* pEnvelope);
	STDMETHOD(putref_Fields)(IFields* pFields);


// FinalConstruct/FinalRelease prototypes
  HRESULT FinalConstruct();
  void    FinalRelease();

private:
	IEnvelopePtr m_ipQueryEnv; // Envelope, for a cursor with spatial search
	long         m_lOID;       // Object ID for a cursor to fetch a single object
	long         m_lCurLineNum;// Current line number within data file
	CComBSTR     m_sFilePath;  // File spec of file holding data
	VARIANT      m_vFieldMap;  // Field map indicating which attributes to fetch
  long *       m_lFieldMap;  // the contents of the fieldmap safe array;

  char         m_sCurrentRow[c_iMaxRowLen]; // buffer for current row in data file
	IGeometryPtr m_ipWorkPoint;// Point geometry to work with
  ifstream     m_fDataFile;  // File stream for text file
	IFieldsPtr   m_ipFields;   // The fields collection of the dataset, used by FastQueryValues

};

#endif //__SIMPLEPOINTCURSORHELPER_H_

⌨️ 快捷键说明

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