Menu

#158 Passing struct output parameter into COM Object

Unscheduled
open
nobody
Feature
5
2017-09-09
2017-09-06
Anonymous
No

Hi, I am trying invoke some ActiveX Object functions, but have no idea about how to pass pSKStock into below functions.

(dispid 5) i4 SKQuoteLib_GetStockByNo 1 ([in] bstr bstrStockNos, [inout] SKSTOCK* pSKStock)

I was able to adapt this one with declare psPageNo first and pass variable name to parameter.

(dispid 3) i4 SKQuoteLib_RequestStocks 1 ([inout] i2* psPageNo, [in] bstr bstrStockNos)

The error messages like below, try several way but still not work.

Unsupported or invalid type information format in parameter
    while executing
"::twapi::IDispatch_Invoke {70115896 IDispatch} {5 0 1 3 {{8 1} {{26 {29 record {{00000000-0000-0000-0000-000000000000}}}} 3}} {bstrStockNos pSKStock}}..."

Is that possible to pass struct data?

Any help would be appreciated.

Discussion

  • Anonymous

    Anonymous - 2017-09-09

    Unfortunately, at this time twapi does not handle struct/record types. It lacks the API's to retrieve the definitions from the type library and generate the appropriate structures and adding it is not straightforward. Sorry.

    /Ashok

     
    • Anonymous

      Anonymous - 2017-09-12

      OK, I will try other way, many thanks :D

       

Anonymous
Anonymous

Add attachments
Cancel