informix
DataBlade Developers Kit User's Guide
Creating ActiveX Value Objects

Implementing ActiveX Value Objects

To implement the client and server projects of an ActiveX value object, you add project-specific logic to particular C++ source files generated by BladeSmith.

This section contains the following subsections:

The Generated Code

The contents of the generated C++ source code differ from generated C source code (described in Chapter 5, Programming DataBlade Module Routines in C) in the following ways:

Adding Project-Specific Logic to the Source Code

For each routine in each support routine category that you specify for a particular opaque type, BladeSmith generates one of the following functions:

Files to Edit

The following table lists each opaque type routine (by category and name), the source file where it is defined, and whether adding project-specific logic to that routine is required or optional.

For information on the usual behavior of the ActiveX custom methods (those defined in the OpaqueCommon.cpp and OpaqueCommon.h files), see Chapter 7, Using ActiveX Value Objects. For information on the default behavior of the server project routines, see Editing Opaque Type Support Routines in opaque.c.

Routine Category Opaque Type Routine/ ActiveX Custom Method Source File Add Logic? (Optional/Required)
Basic Text Input/Output FromString() ToString() OpaqueCommon.cpp Optional Optional
Binary Send/Receive With Client Send() Receive() OpaqueServer.cpp Optional Optional
Text File Import/Export ImportText() ExportText() OpaqueServer.cpp Optional Optional
Binary File Import/Export ImportBinary() ExportBinary() OpaqueServer.cpp Optional Optional
Type Compare Support Compare() Equal()* NotEqual() OpaqueCommon.cpp Optional Optional Optional
B-Tree Indexing Support Equal()* GreaterThan() GreaterThanOrEqual() LessThan() LessThanOrEqual() OpaqueCommon.cpp Optional Optional Optional Optional Optional
Type Mathematic Operators Plus() Minus() Times() Divide() OpaqueCommon.cpp Required Required Required Required
More Mathematic Operators Positive() Negate() OpaqueCommon.cpp Required Required
Type Concatenation Operator Concat() OpaqueCommon.cpp Required
Type Hash Support Hash() OpaqueServer.cpp Required
N.A. IsNull() SetNullFlag() OpaqueCommon.h Optional
* Only one Equal() routine generated, even if you specify all three categories that include it.

ActiveX Properties

If you choose to generate access methods in the BladeSmith New Opaque Type wizard, BladeSmith generates code to make the members of the data structure available as ActiveX properties so the client application developer can access those values.

If a member of an opaque type is an array, the following additional properties are made available:

Accessing Properties Using Visual Basic

This section describes how you can get and set ActiveX properties if you are using Visual Basic as your development environment.

For an ActiveX value object based on the opaque type named Opaque, with a non-array data structure member named x, you can get the corresponding property as follows:

You can set the property as follows:

If a data structure member is an array, you can get the property as follows: