Accessing VB Dlls from ASP

Posted on 2003-02-26
Medium Priority
Last Modified: 2012-06-27
Hi All,

We have some dlls that we are using in a visual basic application and we need to access the same dlls from Asp.

We can access the dlls and the subroutines but we need to initialise one class by using some other classes as parameters.  We can successfully initialise the components but the last class takes these parameters and just will not work.

The error is:

Type mismatch: 'b.InitializeClass'

The code is below.

Can anyone see any problems.

Dim s
Dim f
Dim d
Dim c
Dim pClsUser
Dim b

Public Sub CreateConnection(LngDBTier, LngDepNo, LngLoginSessionID)      
set d = Server.CreateObject ("dllShared.clsConnection")
set b = Server.CreateObject ("dllShared.clsBridge")
set c = Server.CreateObject ("dllShared.clsConstant")
set s = Server.CreateObject ("dllShared.clsSystemInfo")
Call d.EstablishServerConnections(True, True, Clng(LngDBTier))
Call d.EstablishServerConnections(False, True, Clng(LngDBTier))    
Call s.InitializeClass(d.ServerConnUser)
Set pClsUser = LoadUser(LngDepNo, LngLoginSessionID)
'The result of this is clsUser
Call b.InitializeClass
End Sub

Visual Basic Class
Public Sub InitializeClass(lClsSystemInfo As clsSystemInfo, _
        lClsConnection As clsConnection, _
        lClsUser As clsUser, MenuDisp As Integer, ModuleID As Long)

Any help would be appreciated.
Question by:rossgardner
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 28

Accepted Solution

sybe earned 200 total points
ID: 8026721
There is some issue with it. ASP does not have strong typecasting, so every parameter is "variant"

You VB Function does not receive the type it is expecting


Solution in VB:

Public Sub InitializeClass(lClsSystemInfo As Variant, _
       lClsConnection As Variant, _
       lClsUser As Variant, MenuDisp As Variant, ModuleID As Variant)


Author Comment

ID: 8026793
Thanks for the quick reply.

I'll give it a go first thing tomorrow.  

If anyone knows of a work around I would appreciate it as to make these changes will require a new release of the dll which I would like to avoid if possible.

Expert Comment

ID: 8027793
You can also check this link which is abt what sybe suggested

Expert Comment

ID: 9576847
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
LVL 58

Expert Comment

ID: 9753797
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by sybe

Please leave any comments here within the next seven days.
EE Cleanup Volunteer

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question