COM Class Object Sample

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

Description

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.

Using the Sample

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.

Key Project Files

CustomClassObjectDemo.java

This file shows how to implement a custom COM class object.

client.cpp

This file shows how to use a custom class object of a COM object implemented in Java.

remove.bat

This file unregisters the COM component.

Technologies Demonstrated

COM

This sample shows how to:

© 1999 Microsoft Corporation. All rights reserved. Terms of use.