4. Designing and Writing OpenROAD Server Applications : How You Can Drive the OpenROAD Server from a Client : OpenROAD Client 4GL RemoteServer System Class : Call4GL Method
 
Share this page                  
Call4GL Method
The Call4GL method allows the client to call a specified 4GL procedure within the Initiated application, passing named parameters that are expressed as COM VARIANT SAFEARRAY structures.
This method has the following syntax:
integer = RemoteServer.Call4GL(procname,
    [parameter = expression | byref(variable)
    {, parameter = expression | byref(variable)}])
procname
Specifies the name of the procedure to be called (varchar(32)). If the Call method is successful, it returns ER_OK; otherwise, it returns ER_FAIL.
The syntax of the OpenROAD 4GL RemoteServer system class Call4GL method is simple. While it seems to imply that a referenced object is being sent to the OpenROAD Server as an object, this is not the case. Only a snapshot of the data contained in the object is being sent.
For example, sending a StringObject from an OpenROAD 4GL client to the OpenROAD Server is not a complete transfer of the object itself. The text contained in the StringObject is extracted, sent, and then inserted into a default instance of a StringObject in the OpenROAD Server. Only the text is transferred. Other attributes of the StringObject (such as FileHandle or DBHandle) are not transferred.
When a StringObject is sent through ByRef from an OpenROAD 4GL client to the OpenROAD Server, only the text and no other attributes come back. The returned StringObject may or may not be the same instance that was originally referenced. The 4GL client should make no assumptions about this and should rely only on the text value that was returned, not on any other attributes of the StringObject.
The mapping of "one-dimensional array of VT_UI1" to and from LongByteObject is a direct mapping of the binary byte stream. As with StringObject, only the data stream is transferred and no other attributes. The byte stream contained in the LongByteObject is extracted, sent, and then inserted into a default instance of a LongByteObject in the OpenROAD Server.
When a LongByteObject is sent through ByRef from an OpenROAD 4GL client to the OpenROAD Server, only the byte stream value and no other attributes come back. The returned LongByteObject may or may not be the same instance that was originally referenced. The 4GL client should make no assumptions about this and should rely only on the binary value stream that is returned, not on any other attributes of the LongByteObject.
The mapping to and from BitmapObject is indirect, using LongByteObject as an intermediate step. The semantics are identical to using the BitmapObject LoadLong method to convert LongByteObject data into a BitmapObject, or using the LongByteObject LoadValue method to transfer BitmapObject data into a LongByteObject. Only the raw data stream is sent (or returned) from the OpenROAD Server. No other attributes of the BitmapObject are transferred.
Note:  User class structures passed to the RemoteServer Call4GL method must be hierarchical. Circular references and multiple references to the same object instance are not supported. The COM automation array structures allow only a hierarchical nesting.