• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

Accessing VB Dlls from ASP

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
rossgardner
Asked:
rossgardner
1 Solution
 
sybeCommented:
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
 
rossgardnerAuthor Commented:
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
 
farzinmCommented:
You can also check this link which is abt what sybe suggested
http://support.microsoft.com/default.aspx?scid=kb;en-us;244012
0
 
CleanupPingCommented:
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
 
GaryCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now