Product Information > JADE External Interface Developer’s Reference > Chapter 4 - Using External Component Libraries > Editing ActiveX Methods That Return a StringArray

Editing ActiveX Methods That Return a StringArray

JADE ActiveX maps a COM string array into the JADE StringArray type. The maximum length of a string that can be inserted into a StringArray is 62 characters. An exception (1035 - String too long) is raised if you attempt to add a string with greater than 62 characters to the ActiveX array.

If you edit the methods generated by the ActiveX import, you can use the HugeStringArray type in place of the StringArray type. This allows strings with a length up to 2047 characters before an exception is raised.

To make use of a HugeStringArray, you need to tell the ActiveX interface to use them. In the following example, an ActiveX object implements a member method called ListOfThings that returns an array of strings. The JADE method generated by the import for such a member is as follows.

listOfThings():StringArray updating, clientExecution;
begin
    return _jadeActiveXInvoke("ListOfThings" 1,'0.8200').StringArray;
end;

To enable the method to handle a HugeStringArray:

After making the changes, the listOfThings method is as follows.

listOfThings():HugeStringArray updating, clientExecution;
begin
    return _jadeActiveXInvoke("ListOfThings" 1,
                   '0.8200.'&HugeStringArray.number.String).HugeStringArray;
end;

As the class number of the HugeStringArray class is 429, the method can be simplified as follows.

listOfThings():HugeStringArray updating, clientExecution;
begin
   return _jadeActiveXInvoke("ListOfThings" 1,'0.8200.429').HugeStringArray;
end;

You may need to make similar changes in two places; in the ActiveXControl or ActiveXAutomation subclass, and also in the corresponding IDispatch interface subclass.