Pass By Reference problem with VBscript

vb6 Ireland
  • 16 years ago

    Hello,


    I am trying to call an ActiveX Dll from VBscript in ASP. The Pass By Reference call takes a String array and a Long as arguments. In the DLL I have changed these to Variant so that ASP will understand them, like so:


    Public Sub EnumerateAllSections(ByRef sSections As Variant, ByRef iCount As Variant)


    In the ASP code I have declared the variables with just the DIM keyword, as shown below:


    Dim sSections
    Dim iSectionCount


    And I call the Sub in ASP as shown here:


    With m_cIni
                   .Path = "F:\from vinny\DOCOweb\settings\formats.ini"
                   .EnumerateAllSections sSections, iSectionCount     ' this line always gives an error
    End With


    I have tried declaring sSections as an array with () but whatever I try I just get a Type Mismatch or Subscript our of range exception.


    I have googled for solutions and I think the above would work for a String but not a String Array, and I can't figure out why!


    Any suggestions on how I can deal with would be greatly appreciated


    Shane

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The greatest performance improvement of all is when a system goes from not-working to working.” - John Ousterhout