Uniface User Forum

 View Only
  • 1.  Import type libraries: vector parameter to be supplied

    Posted 12-09-2022 08:43
    Edited by Gianni Sandigliano 12-11-2022 14:28

    Hi Unifacers,

    I've imported in Uniface definitions from a "type library". Everything went as expected: so far so good.
    In one signature imported one of the parameters to be used is defined into documentation as an integer bidimensional vector (an xy matrix) and it should physically start from position 0, like in many other low level languages.

    Question#1:
    Uniface automatic import of type library has defined this parameter as string / VT_VARIANT...is this correct?
    If NO: which data type and which physical type should be mapped to?

    Question#2:
    initially accepting string /VT_VARIANT data type as correct I have tried to use the signature passing to this parameter a Uniface list; supposing the matrix in my sample should be composed by 5 x 2 positions I've tried 6 different code solutions:
    - passing a single list composed from 5 x 2 = 10 positions, using base position 1 for object referred to
    - passing a list composed from 2 rows each with 5 positions, using base position 1 for object referred to
    - passing a list composed from 5 rows each with 2 position, using base position 1 for object referred to
    - passing a single list composed from 5 x 2 = 10 positions, using base position 0 for object referred to
    - passing a list composed from 2 rows each with 5 positions, using base position 0 for object referred to
    - passing a list composed from 5 rows each with 2 position, using base position 0 for object referred to
    No one it is working!
    I am getting everytime -150 with an exception thrown to ICC from the called software.
    Continuing to go with a "trial and error" approach is frustrating.
    Could anyone point me in the right direction on how to compose and pass this param?

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------


  • 2.  RE: Import type libraries: vector parameter to be supplied

    ROCKETEER
    Posted 12-13-2022 13:03
    Hi Gianni,

    Did you check if there were any warnings during the import of the type library? In case Uniface does not understand something then there should be a warning (or in the worst case an error). If nothing was reported for this specific parameter then the parameter is most likely defined in the type library as VT_VARIANT (and by default that will be mapped to a string). I know that in some  cases a parameter can accept different data types depending on the context. In that case you need to tell Uniface what it should use (e.g. numeric, string, boolean, ...).

    And the data mapping used by the COM Call-Out API is documented here: COM and Uniface Parameter Data Types. You can find the info in the Uniface Library documentation:

    • Integrating with Other Technologies > COM and DCOM > COM Connector > COM and Uniface Parameter Data Types

    I cannot recall that I ever encountered a parameter of the type integer bi-dimensional vector. There are, however, certain COM parameters that are not supported. I am sorry. In such a case you might need to create a wrapper object that does the actual call to the COM object and then expose a Uniface-friendly interface that you could access through (e.g.) COM Call-Out.

    I hope this helps.

    Regards,
    Daniel

    ------------------------------
    Daniel Iseli
    Principal Technical Support Engineer
    Uniface Services
    Rocket Software, Switzerland
    ------------------------------



  • 3.  RE: Import type libraries: vector parameter to be supplied

    Posted 12-15-2022 15:29

    Hi Daniel,

    thanks for your answer.

    In the documentation page you have linked I do not see any support on the COM side for vectors or matrixes, excluding ADO.recordsets and raw streams, which are specific cases, outside my perimeter.

    IMHO all examples into documentation are related to simple things, maybe too simple things.

    Based on this I land to the wrapper solution also if I do not like it and the customer neither.

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------