Visual C++: Code Sample Information

The Visual C++ OSP Simple Provider sample is set up to have MyOSPObject as the implementation of the Sample Provider, and MyDataSource as the implementation of the Data Source object.

The Microsoft Visual C++ Simple Provider code sample is located in ..\samples\osp\vc and consists of the following files:

File Name Description
MyOSPObject.h Class and method definitions for MyOSPObject.
MyOSPObject.cpp Implementation code for MyOSPObject. Contains the following:
  • Constructor and destructor, initialization routines, QueryInterface of MyOSPObject.

  • Routines to create an internal table, load data into the table from an external file, and save the data.

  • OSP method implementations.
MyDataSource.h Class and method definitions for MyDataSource.
MyDataSource.cpp Implements the MyDataSource object and its IDataSource methods. Contains the following:
  • Constructor and destructor, initialization routines, QueryInterface of MyDataSource.

  • IDataSource method implementations, including getDataMember, which gets the OSP implementation.
MyClassFactory.h Contains the class definitions for MyClassFactory and the DLL entry points.
MyClassFactory.cpp The sample's implementation of the IClassFactory interface. Implements the main DLL entry point.
SampleOSP_VC.def Names the overall DLL and lists the entry points.
SampleOSP_VC.dsp Visual C++ project file for the sample.
SampleOSP_VC.reg Copy of the RegisterProvider.reg file for use with the Visual C++ sample.
Common.cpp Common VC++ routines used for this sample.
Common.h Set of common VC++ macros used for this sample.