Click here to Skip to main content
15,897,704 members
Articles / Desktop Programming / MFC

Creating an OLE DB Data Provider

Rate me:
Please Sign up or sign in to vote.
3.45/5 (13 votes)
12 Jan 20029 min read 128.3K   3.4K   69  
This article shows how to create an OLE DB Data Provider that wraps both a C struct and C++ class containing data that is to be made accessible by a SQL query.
/* this ALWAYS GENERATED file contains the definitions for the interfaces */


/* File created by MIDL compiler version 5.01.0164 */
/* at Mon Jan 07 15:20:25 2002
 */
/* Compiler settings for E:\src\mdac\Prototypes\SensorProv\SensorTest\SensorTest.idl:
    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
    error checks: allocation ref bounds_check enum stub_data 
*/
//@@MIDL_FILE_HEADING(  )


/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __SensorTest_h__
#define __SensorTest_h__

#ifdef __cplusplus
extern "C"{
#endif 

/* Forward Declarations */ 

#ifndef __MySensor_FWD_DEFINED__
#define __MySensor_FWD_DEFINED__

#ifdef __cplusplus
typedef class MySensor MySensor;
#else
typedef struct MySensor MySensor;
#endif /* __cplusplus */

#endif 	/* __MySensor_FWD_DEFINED__ */


/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"

void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 


#ifndef __SENSORTESTLib_LIBRARY_DEFINED__
#define __SENSORTESTLib_LIBRARY_DEFINED__

/* library SENSORTESTLib */
/* [helpstring][version][uuid] */ 


EXTERN_C const IID LIBID_SENSORTESTLib;

EXTERN_C const CLSID CLSID_MySensor;

#ifdef __cplusplus

class DECLSPEC_UUID("0B7E70F3-95F6-4994-9241-D8C52206C232")
MySensor;
#endif
#endif /* __SENSORTESTLib_LIBRARY_DEFINED__ */

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
David Utz
Senior Software Engineer
Analytical Graphics, Inc.
40 General Warren Blvd.
Malvern, PA 19355
dutz@stk.com

Comments and Discussions