byref Arrays -- getting myASPinline

Results 1 to 2 of 2

Thread: byref Arrays -- getting myASPinline

  1. #1
    Carlos VBer Guest

    Default byref Arrays -- getting myASPinline

    My supervisor insists on passing empty arrays byref into an MTS dll and getting back a recordset in array form -- in the passed-in argument. Well the recordset is coming from another MTS dll, which is using getRows to return the array into a byref argument. <BR><BR>I&#039ve seen the article successfully assigning the getrows return to the dll function return, to an asp page, but I&#039m passing an array byref as an argument to do it, which is not so great. I&#039ve used byref arrays in another dll in a similar way, but I can&#039t figure out what the problem is with this one.<BR><BR>Has anyone done this before, and if so, what are the mistakes to watch out for? It is hard to understand why a dll can work fine with byref variant arrays in VB and MTS, and then bomb in ASP. I&#039m losing track of all the ways I&#039ve dimmed and redimmed and passed with parenthesis or not, to try to fix this.<BR><BR>Any insight at all will help. Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: byref Arrays -- getting myASPinline

    VBS does *not* want or expect an array return value. Remember, *all* variables in VBS are VARIANTs. So you need to return a VARIANT that is a reference to an array of VARIANT.<BR><BR>I&#039m not a VB person, but I *think* the proper declaration is something like:<BR><BR>Sub whatever( ByRef arg AS Variant )<BR> ...<BR> ... create an array of Variant ...<BR> arg = theArrayOfVariants<BR>End Sub<BR><BR>I think it does zero good to declare the argument as an array in your VBS code...could even be considered an error, I guess...<BR><BR>I understand all of this better at the C++ level; sorry I am unclear here. But this *can* be done with the proper declarations in VB--I&#039ve seen others do it.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts