Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2004, 11:56 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default Problem with reading array from ActiveX DLL

Hi

I have created a ActiveX DLL in VB6 that return a array. What the dll does is query a table and write the values to an array. I need to access this array to build my asp page dynamicly. To get the array from a VB6 form(as a test) I use:

******
Dim strings() As String
Dim i As Integer
    ' Get the array of strings.
    strings = numberlist()
For i = LBound(strings) To UBound(strings)
        If i >= 0 Then
        A = strings(i)
        Debug.Print A
        End If
    Next i
**************** This works perfectly
In my ASP page Im trying this:

*********************
Dim strings
Dim i
Set objChoices = Server.CreateObject("cChoicesArray.cChoices")
strings = objChoices.numberlist()
For i = LBound(strings) To UBound(strings)
        If i >= 0 Then
         response.write(strings(i))
        End If
Next
Set objChoices = Nothing
************************
Fisrt I tried to remove the i after next as I got this err:

Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/reporting/choices.asp, line 20, column 5
Next i
----^

Once I removed that Im getting this error:

Microsoft VBScript runtime (0x800A000D)
Type mismatch
/reporting/choices.asp, line 18

Where Line 18 = response.write(strings(i)). I have also tried varA = strings(i) but it gives me the same error...

Any ideas appreciated.

Regards
Marnus
 
Old June 15th, 2004, 02:00 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

Hi

I have managed to sort this one out. The problem was in the DLL. I declared the array as string instead of variant...

Regards
Marnus





Similar Threads
Thread Thread Starter Forum Replies Last Post
Activex Dll Problem, Error in : Class does not sup cmualo Pro VB 6 2 May 22nd, 2007 09:38 AM
Advantages /Disadvantages of ActiveX DLL & ActiveX priyank Beginning VB 6 6 February 19th, 2007 11:34 AM
ActiveX DLL Joann Beginning VB 6 6 January 25th, 2007 08:50 PM
creating an activex dll amc VB Components 7 June 25th, 2004 05:10 PM
Create an ActiveX DLL .... miglou VS.NET 2002/2003 1 September 23rd, 2003 08:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.