Visual C++: Information and Guidelines
Here is a brief outline of the steps needed to build the OSP component in Visual C++:
-
Create an Automation object with standard registration.
-
Implement IDataSource on the object.
-
Implement the methods for OLEDBSimpleProvider with the object (at least once).
Registration
In Visual C++, you create your own ProgID for the OSP Data Object, and use it when registering the OLE DB provider. Because you control the DLLRegisterServer function, you can use it to write the registry entries instead of running a copy of the supplied RegisterProvider.reg file.
Programming Notes
-
When compiling in Visual C++, make sure to point to the Include directory where the OLE DB and OLEDBSimpleProvider header files are located.
-
When linking in Visual C++, make sure to add the path for the LIB files so you can link the LIB file containing the IIDs for the Simple Provider interfaces and classes.
-
In Visual C++ implementations, use IDataSource to expose the correct OSP implementation to the Simple Provider DLL (MSDAOSP.DLL).
-
When coding data source notifications in Visual C++, use the addDataSourceListener and removeDataSourceListener methods of IDataSource to add and remove listeners.