Special Properties

CLSID (alphanumeric)

This special property is provided for advanced programming tasks that require a generic interface to ActiveX controls. You may create, modify, inquire and destroy an ActiveX control using the ACTIVE-X control type, but with certain restrictions. The compiler will not recognize symbolic property, method, or event names provided by the ActiveX control. You must specify properties and methods by their dispatch identifier (dispid) using the PROPERTY phrase, and you must identify events by their dispatch identifier in your event procedure. ACTIVE-X controls are identified by a globally unique identifier called a class id (CLSID). In order to create an instance of an ACTIVE-X control, you must provide this class id. Set CLSID to the class id of the control when you create the control (either in the screen section definition or in the DISPLAY statement).

LICENSE-KEY (alphanumeric)

Some ActiveX controls require a deployment license that is different than the development license. The vendor may or may not include that deployment license as part of the control's installation, depending on the ability of the appropriate development tool to discover that deployment license and embed it in the application. AXDEFGEN is able to discover the deployment license, and set a LICENSE-KEY property in the generated COPY file. In this case, your application is ready for distribution with only the ActiveX control.

INITIAL-STATE (multiple parameters)

Use INITIAL-STATE in conjunction with the C$RESOURCE library routine to establish the ActiveX control's initial state.

{ INITIAL-STATE } { Is  } ( resource-handle, resource-name )
                  { Are }
                  { =   }

where:

resource-handle     is a HANDLE OF RESOURCE
resource-name is a literal or data-item

General Rules

  • resource-handle must be the handle of an open resource file. It is obtained by calling the C$RESOURCE library routine
  • resource-name must be the name of a resource item in the resource file whose handle is specified in resource-handle
  • INITIAL-STATE is set only once per control instance. After a program creates an ActiveX control, only the first DISPLAY or MODIFY that specifies INITIAL-STATE will set it
  • INITIAL-STATE failure raises one of the following exceptions:
    ACU-E-INITIALSTATE Error reading resource item from resource file
    ACU-E-INVALIDHANDLE     Invalid control handle
    ACU-E-UNEXPECTED Unexpected error

Example

77 RES-HANDLE USAGE HANDLE OF RESOURCE

CALL "C$RESOURCE" USING CRESOURCE-LOAD, "PROGRAM1.RES"
   GIVING RES-HANDLE.

To set the ActiveX control's initial state:

DISPLAY Calendar LINE 4 COLUMN 6 LINES 10 SIZE 40
   INITIAL-STATE (RES-HANDLE, "CALENDAR-1-INITIAL-STATE")
   HANDLE IN CALENDAR-1.

or in the screen section:

03 CALENDAR-1 Calendar LINE 4 COLUMN 6 LINES 10 SIZE 40 
   INITIAL-STATE (RES-HANDLE, "CALENDAR-1-INITIAL-STATE").

CALENDAR-1-INITIAL-STATE is the name of a resource in PROGRAM1.RES. Its binary value is the initial state of the CALENDAR-1 ActiveX control. Note that each program that contains ActiveX controls generally has its own resource file.