?
Solved

Accessing VB Dlls from ASP

Posted on 2003-02-26
6
Medium Priority
?
272 Views
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.

'Globals
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
(s,d,pClsUser,0,0)
 
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.
0
Comment
Question by:rossgardner
[X]
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
6 Comments
 
LVL 28

Accepted Solution

by:
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

See:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20404298.html

Solution in VB:

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






0
 

Author Comment

by:rossgardner
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.
0
 
LVL 4

Expert Comment

by:farzinm
ID: 8027793
You can also check this link which is abt what sybe suggested
http://support.microsoft.com/default.aspx?scid=kb;en-us;244012
0
 

Expert Comment

by:CleanupPing
ID: 9576847
rossgardner:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 58

Expert Comment

by:Gary
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.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

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