OGIS OLE DB Provider
ESRIUtil.h
// Copyright 2012 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See the use restrictions.
// 

#if ! defined( _DATAUTIL_H )
#define _DATAUTIL_H

namespace ESRIutil
{
  HRESULT GetSpatialReference(ISpatialReference *pSpatialRef, BSTR* spatialRefBuf);

  HRESULT GetSpatialReference(IUnknown *pUnknown, BSTR *spatialRefBuf);

  HRESULT GetGeometryAndOIDFields(IDatasetName *pDatasetName, IField **ppGeomtryField, IField **ppOIDField);

  HRESULT GetOIDAndGeometryColNames(
    IDatasetName *pDatasetName,
    BSTR *oidName,
    BSTR *blobName
  );
  
  HRESULT GetOGISWkb(IUnknown *pUnkVal, IUnknown **pIUnknown);

  HRESULT GetOGISWkb(IUnknown *pUnkVal, BYTE array[], long nSize);
};

#endif