View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MB Blackburn MB Blackburn is offline
external usenet poster
 
Posts: 1
Default SAFEARRAY [in] and [out]

I tried posting this over in microsoft.public.office.developer.automation &
microsoft.public.vb.ole.automation.
But no one has answered there so I'm going to give this group a shot!

I have a question about VBA code in Excel.
It is talking to an ActiveX component.
Several methods in the component have method signatures that contain [in]
parameters of type SAFEARRAY.
More precisely the idl code reads:
[in] SAFEARRAY (float)* for the input and [out, retval] SAFEARRAY (float)*
for the output.

When I call a method with the [in] SAFEARRAY param, life is good.
However, when I try to call a method with the [out, retval] SAFEARRAY param,
the methods fails with message: Unsupported automation type.
To get the method to work I have to change the idl code to read: [out,
retval] VARIANT *

The question: why is the SAFEARRAY recognized as a legit type for in params
but not out params?

m blackburn