CALLOCX

Contents


Callocx makes it possible to use COM OBJects (OLE, ActiveX,...).

Prerequisites

Beside the standard interfaces, the OBJects called by the Callocx instruction MUST absolutely implement the following interfaces:

Syntax

   Callocx return=""with param_list

Parameters

Element

Description

Restrictions

return

returns the information in the form of a table of character strings

list_param

List of id_param separated by the character ','.

The expressions must be alphanumeric and are limited to 255.

Examples

############################################################
#--- Creation of the graphical OBJect
Local Char RETOUR(20)
Callocx RETOUR="" With
& "X3Action=" +chr$(1)+ "1",
& "X3Identification=" +chr$(1)+ "VtChartLib.VtChart",
& "X3Window=" +chr$(1)+ "0",
& "X3Left=" +chr$(1)+ "1",
& "X3Top=" +chr$(1)+ "1",
& "X3Right=" +chr$(1)+ "340",
& "X3Bottom=" +chr$(1)+ "200",
& "X3GetFile=" +chr$(1)+ filpath("GRAPH","Chart_line_1","vtc"),
& "Repaint=" +chr$(1)+ '10"%d"' + "0"

#--- Retrieval of the identification number of the OBJect
If (left$(RETOUR,9) = "X3Number=") Then
    GOCXID = mid$(RETOUR,11,1)
Endif

############################################################
#--- Modification of the OBJect with
# - title and footnote text
# - number of columns and rows
# - number of column and row labelsLocal Char WCLI(255)
WCLI = "$ADXDIR\Report\GX3APP_gailf50_1801\Chart_line_1.vtc"
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "ReadFromFile=" +chr$(1)+ '30"%z"' + WCLI,
& "FootnoteText=" +chr$(1)+ '10"%s"' + "graph footer",
& "TitleText=" +chr$(1)+ '10"%s"' + "graph title",
& "ColumnCount=" +chr$(1)+ '10"%d"' + "1",
& "RowCount=" +chr$(1)+ '10"%d"' + "6",
& "ColumnLabelCount=" +chr$(1)+ '10"%d"' + "1",
& "RowLabelCount=" +chr$(1)+ '10"%d"' + "6"

############################################################
#--- Loading of data
Local Decimal WDAT(6)
WDAT(0)=20
WDAT(1)=40
WDAT(2)=65
WDAT(3)=15
WDAT(4)=10
WDAT(5)=10
For WROW = 1 To 6
    Callocx "" With
    & "X3Action=" +chr$(1)+ "2",
    & "X3Number=" +chr$(1)+ GOCXID,
    & "Column=" +chr$(1)+ '10"%d"' + "1",
    & "Row=" +chr$(1)+ '10"%d"' + num$(WROW),
    & "Data=" +chr$(1)+ '10".s"' + num$(WDAT(WROW-1))
Next WROW

############################################################
# Loading the x-axis labels
For WROW = 1 To 6
Callocx "" With
    & "X3Action=" +chr$(1)+ "2",
    & "X3Number=" +chr$(1)+ GOCXID,
    & "RowLabelIndex=" +chr$(1)+ '10"%d"' + "1",
    & "Row=" +chr$(1)+ '10"%d"' + num$(WROW),
    & "RowLabel=" +chr$(1)+ '10"%s"' + month$(WROW)
Next WROW

############################################################
# The OCX is repainted and the window is activated
Callocx "" With
& "X3Action=" +chr$(1)+ "2",
& "X3Number=" +chr$(1)+ GOCXID,
& "X3Activation=" +chr$(1)+ "1",
& "Repaint=" +chr$(1)+ '10"%d"' + "1"
End

Description and comments

The Callocx statement makes it possible to use COM OBJects (OLE, ActiveX,...) in order to submit results in graphical form, for instance.

For the graphs, a standard structure of the graph must be previously generated in Visual Basic on PC. It is then stored on the server in the GRAPH directory of the folder with the extensin *.vtc. When used, it is transferred and stored on the client in the x3\report\folder_server_port directory. If such a structure is present on the client workstation, there are no transfers from the server.

This structure defines the initial presentation, such as:

This initial presentation can be modified upon execution at client workstation level. The modifiable data are:

There are standard parameters (starting with X3) and parameters specific to the OCX.

Standard parameters

Parameters are passed under the form:

Parameter=Index+Value

Value must be alphanumerical and limitted to 255. This value is preceded by an index over one character thus allowing all the values for a given parameter to be regrouped and thus the limit of 255 characters to exceed for this parameter.

The standard parameters to be entered to call the Ocx are the following:

Parameter

Description

Value

X3Action

Executes an action for the OBJect

"1" : Creation
"2 ": Modification
"3": Deletion
"4": Provides access to the OBJect
"5": Query of the OBJect

X3Number

Identifies an OBJect.
This number is returned by X3 when creating the OBJect
It must then be passed for any action on the same OBJect.

over 1 character.

X3Event

Used to manage or not the events from the COM OBJect
(upon creation of the OBJect)

"0" or "1"

X3Message

Those events that should be received.
For negative figures, use the DISPID with a complement at FF+1
For instance: a DISPID at oxfffffda6 becomes -602

Event number

X3Identification

Identifies the OBJect that needs to be created
This name must be independent from the version.

character string

X3Window

Number of the window to which the OBJect is attached.
If this number is 0, a deactivated window of dialog type is created to support the OBJect.
Otherwise, this window must be defined at X3 application level and it will then be an in-place
activation (later version).

"0"

X3Left

Left position of the OBJect at the fourth of the column

numerical position

X3Top

Top position of the OBJect at the eigth of the line.

numerical position

X3Right

Right position of the OBJect at the fourth of the column

numerical position

X3Bottom

Bottom position of the OBJect at the eigth of the line.

numerical position

X3Activation

Activates or deactivates the window that supports the Ocx. For lengthy processes, it is necessary to deactivate the window to avoid problems with the operator's handling operations.

"0" : deactivation
"1": activation

X3GetFile

Access path and name of the *.vtc file on the server

Parameters specific to the Ocx

Each Ocx will have its own properties and methods. Parameters are passed under the form:

Parameter=Index+Format field+Value

Index : corresponds to the value of a same parameter being continued (similar to the standard parameters).

Format field: comprised of the requested function type, a Sub-type (not used in this version) and, mentioned between brackets, the Format that needs to specify the type of the transmitted data and the separation character between two data.

Function type:

1 : indicates an incoming property (PUT)
2: indicates an outgoing property (PUT)
3: indicates a method

Sub-type:

0 : only value allowed for this version

Format:

"%d": designates a numerical field passed by value to the OBJect
"%s": designates an alphanumerical field passed by value to the OBJect
"%z": indicates a field with constant. Only the ADXDIR constant is managed in this version.
".s": indicates a numerical field to be passed as an alphanumerical value to the OBJect and that must be submitted to the local
transformations (decimal separator)

Separator:

1st example, "%d;%s" specifies that the following string is comprised of a numerical field and an alphanumerical string to be found after the semi colon.

2nd example, "%d;%s,%d" 123; test with figures 4563.23 ,45
will give the value for the 1st parameter: 123
                                 for the 2nd:    test with figures 4563.23
                                 for the 3rd:    45

specifies that the following string is comprised of a numerical field and an alphanumerical string to be found after the semi colon.

# For instance, for the graph management OCX (First impression 5), the following is obtained: Callocx RETOUR ="" With
& "X3Action="+chr$(1)+"2",
& "X3Number="+chr$(1)+GOCXID,
& "ReadFromFile="+chr$(1)+'30"%s"' + "c:\trf\test.vtc",
& "ColumnCount="+chr$(1)+'10"%d"' + "4",
& "RowCount="+chr$(1)+'10"%d"' + "5",
& "TitletextColumnCount="+chr$(1)+'10"%s"' + "C'est le titre du graphe",
& "MenuItemVisible="+chr$(1)+'10"%d,%d"' + "0,0"

# ReadFromFile is a method with a string type parameter.
#
ColumnCount is an incoming property with a numerical parameter.
#
RowCount is an incoming property with a numerical parameter.
#
TitletextColumnCount is an incoming property with a string type parameter
#
MenuItemVisible is an incoming property with two numerical parameters
# separated by a comma.

Information on these parameters can be found in OLE Object Viewer of Microsoft Visual Studio, for instance.

Return format for an event

990="format""values"

The format:

This is a string comprised of:

The value:

They are subdivided according to the format:

For instance:

#XF"the string":  it is a string of 35 alphanumerical characters whose value is "the string".

Remarks

A 5 order can only return one value.

A property can only be accessed once in a message.

It is necessary to use X3Activation to manage the tunnels from an OBJect.

Events can be negative.

Web specificities

Not available in Web version

Associated errors

Error

Description

 

 

Associated keywords


CONTENTS

Copyright © Sage 1999 - 2007