Simple OCX Control Sample

This sample is located in \Samples\Wfc\SimpleOCXControl.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This sample shows how to build a simple control and to declare its properties and events so that they can be displayed and manipulated in the Properties window of the Windows Foundation Classes (WFC) Forms Designer.

The control includes a Simple Custom Property and a Property Editor. The control also hides the properties of com.ms.wfc.ui.Control that are not appropriate.

The control is exposed as a Microsoft® ActiveX® Control using the @com.register flag and is packaged as a DLL.

Using the Sample

To compile the sample

  1. Build Simpcomp by running nmake. This will compile the Java files, register the control, create a type library, and package the control into a DLL.

  2. Open the Microsoft® Visual Basic® project and add SimpComp to the Toolbox. Then, add a SimpleControl to the form and run it.

    Note   You may need to add the control to the Visual Basic Toolbox to correctly register it.

Key Project Files

SimpleControl.java

Contains the Simple Control.

\Samples\Wfc\SimpleOCXControl\JavaTest.exe

Contains a sample form that demonstrates how to include the control as a WFC control on a WFC form.

\Samples\Wfc\SimpleOCXControl\VBTest

Contains a sample Visual Basic form that demonstrates how to include the control as an ActiveX Control on a Visual Basic Form.

Technologies Demonstrated

WFC

This sample shows how to use:

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