Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP VBSCript problem calling a VB function

Status
Not open for further replies.

R3D3

Programmer
May 1, 2002
34
FR
From ASP VBSCript I have a problem calling a VB function I've written.
In the ASP...
'The objxml is correctly formed at this point
'defined as.... set objxml=server.CreateObject ("Microsoft.XMLDOM")
'Then
set objapi=server.CreateObject("FA_Hotel_Project.Hotel")
objapi.HotelSearch(objxml)
'The function Hotel search runs ok but how do I get the result out of the function?
'If I use the following then I am told that there is a Type Mismatch
' set Dumxml=server.CreateObject ("Microsoft.XMLDOM")
' set Dumxml=objapi.HotelSearch(objxml)
'
'In the DLL I have written the VB function HotelSearch with the following definition
' Public Function HotelSearch(xDocASP As DOMDocument) As DOMDocument
' and I have checked the content of HotelSearch object just before Exit Function
' Works fine if I have a VB exe calling the same function but from ASP VBScript I am struggling
' I could use a different return object instead of HotelSearch and again it is OK
' so is it something in the definition of HotelSearch?


ANY IDEAS WELCOMED
 
The solution was NOT to specify a TYPE in the function being called. Worked fine by taking it out.
 
I had exactly the same problem as R3D3 however my solution is slightly different.

My function call was something like this:
Public Function functName(abc As string) As DOMDocument

I found that in order to get it working all I had to do was to call the parameter as byval. i.e.:

Public Function functName(byval abc As string) As DOMDocument

Blue Skies! Soft Landings!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top