Re: Arrays passed as parameters from VB ActiveX DLL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Ben" <ben@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43c50f3f$1_1@xxxxxxxxxxxxxxxxxxxxxx
> I need to call a VB function that passes out variants that are in fact
> arrays. The function is declared as follows...
>
> Public Function VAX_Directory(ByVal pstr_VAX_Directory As String, _
> ByVal pstr_VAX_Filename As String, _
> Optional pstr_Filelist As Variant, _
> Optional pstr_Datelist As Variant, _
> Optional pstr_Sizelist As Variant, _
> Optional pstr_Attrlist As Variant) As
> Integer
>
> I have managed to pass the String parameters into the function
> correctly using BSTR, but don't know how to declare the array
> parameters. I have tried using a SAFEARRAY, but with no luck.

You say they are [out] parameters. So you pass in a VARIANT* initialized
to VT_EMPTY, and the function fills in a safearray and sets the type to
VT_ARRAY | VT_SomeType.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Using 2 dimensional SAFEARRAYS with COM
    ... For example a SAEEARRAY of arrays. ... declare it as a function parameter. ... But how do I do this with a SAFEARRAY of arrays for BYTES. ... A Safearray is just another kind of Variant, ...
    (microsoft.public.vb.com)
  • Re: Copying Arrays
    ... how to reference the data within variant arrays. ... :> Private Sub Command1_Click ... :>: declared as variants, but contain the same type of data for example, ... :> Dim x As xtype ...
    (microsoft.public.vb.controls)
  • RE: Arrays - declaration, adding values to arrays and calculation
    ... Your declarations for bigdata and small data are fine, ... smalldata = Range.Resize ... I am a VBA beginner and would like to learn declaring arrays and using ... I want to declare three arrays BigData, ...
    (microsoft.public.excel.programming)
  • Re: RAD vs. performance
    ... That would automatically be inferred in my language and while ... Polymorphic variants are rarely used and ordinary ... the need to declare such things is completely gone. ... general, not specific, in that it had multiple "subtypes," if you will. ...
    (comp.lang.misc)
  • Re: Performance of hand-optimised assembly
    ... DECLARE that those arrays are properly aligned and are suitable ... brittle machinery to DEDUCE that instead? ... usage of that variable it must be an int? ...
    (comp.lang.c)