This sample is located in \Samples\COM\COMClassObject.
Note To use this sample, it is recommended that you have Microsoft® Visual C++® version 5.0 or higher installed.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
This sample shows how to implement a custom COM class object that supports the interface IClassFactory2. It also includes a small client implementation that creates a Java/COM object through the IClassFactory2 interface exposed by the custom class object.
To compile the sample
Run Nmake.exe to compile the makefile in \Samples\COM\COMClassObject.
To run the sample
Run Client.exe in \Samples\COM\COMClassObject. The sample should display the following message:
failed to CoCreateInstance object as expected (hr=CLASS_E_NOTLICENSED) successfully called CreateInstanceLic
To unregister the COM component
Run Remove.bat in \Samples\COM\COMClassObject.
This file shows how to implement a custom COM class object.
client.cppThis file shows how to use a custom class object of a COM object implemented in Java.
remove.batThis file unregisters the COM component.
This sample shows how to: