INFORMIX
DataBlade Developers Kit User's Guide
Chapter 6: Creating ActiveX Value Objects
Home Contents Index Master Index New Book

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 first provides an overview to the source code generated by BladeSmith, and then describes more specifically what you must add.

Source Code Generated by BladeSmith

This section provides an overview of the code that BladeSmith generates for client and server projects. For a complete list of generated files, see Appendix A, "Source Files Generated for C DataBlade Modules."

BladeSmith generates the following source code for each client and server project:

BladeSmith generates the following source code for each ActiveX value object:

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:

    You must supply project-specific internal logic to these routines.

    You can keep the default logic, or you can replace or modify it as appropriate for your project.

Add your project-specific logic to the following files, where Opaque is the name of the opaque type you defined:

OpaqueCommon.cpp

Contains the logic for the opaque type routines that are implemented both as ActiveX custom methods and server project routines.

OpaqueCommon.h

Contains the logic for the IsNull() and SetNullFlag() custom methods.

OpaqueServer.cpp

Contains the logic for the opaque type routines that are implemented only for the server project.

Important: In addition to adding logic to the opaque support routines, you can add your own functions to the C++ classes in the OpaqueCommon, OpaqueClient, and OpaqueServer .cpp and .h files. Do not modify any other of the generated source files.
The rest of this section contains programming guidelines for editing the source code, and then lists the routines to edit.

Programming Guidelines

Informix recommends that you follow these rules and guidelines when editing the source code for your client and server projects:

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 "Code Generated for Opaque Type Support Routines".

(1 of 3)

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

R-Tree Indexing Support

Equal()*

Contains()

Inter()

Overlap()

Size()

Union()

Within()

OpaqueCommon.cpp

Optional

Optional

Required

Optional

Required

Required

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