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).
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.
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 |
ACU-E-INITIALSTATE | Error reading resource item from resource file |
ACU-E-INVALIDHANDLE | Invalid control handle |
ACU-E-UNEXPECTED | Unexpected error |
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.