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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with dll

Status
Not open for further replies.

Alira

Programmer
Mar 21, 2001
77
CA
I was asking yesterday about type missmatch when sending parameters to a dll from ASP.
Nothing helped so far.
Today I tried to create another dll and found something strange.
If I send only one parameter to a dll it works. I I'm trying to send two or more parameters I get this "Type missmatch" error.
Why could this be?
 
Are you passing in the proper variable type that the dll requests?

For example if you have a method that takes a string and a single, are you casting them into that type?

myObject.MyMethod(CSTR(strVariable),CSNG(sngVariable))

I could be totally confused by your question, but I'm giving it a shot.

shorty
 
All variables are string type and dll expects strings.
And I get this error...
 
Here is the code

dim objfirst
dim strMy
sTelephone = Request.Form("PhoneNo")
sClient_Name = Request.Form("Name")
sTopic = Request.Form("TypeofQuery")
sExpires = Request.Form("Expire")
sHours = Request.Form("Hours")

'Create an instance of the Component'
Set objfierst = Server.CreateObject("IQWCBR.WCBR")

'Call the function in component, and store the result'
strMy=objfirst.SendRequest (sTelephone,sClient_Name,sTopic,sExpires,sHours)

And this is the code of dll function

Public Function SendRequest(sTelephone As String, sClient_Name As String, sTopic As String, _
sExpires As String, Optional sHours As String) As String

Dim sRtn As String

gsIPAdd = sIPAdd
gsTelephone = sTelephone
gsClient_Name = sClient_Name
gsTopic = sTopic
giExpires = CInt(sExpires) '1 for YES and 0 for NO
giHours = CInt(sHours)


sRtn = frmMail.StartMail

If sRtn = "Success" Then
App.LogEvent "Web Callback Submitted Successfully.", vbLogEventTypeInformation
SendRequest = "Success"
End If

End Function
 
You are NOT sending strings. You are sending Variants containing a string. VBScript does not have any data type but Variant. If you DLL is not expecting Variants then you have a type mismatch. The only thing you can TRY (and I've never done this) without changing the DLL is
strMy = objfirst.SendRequest (Cstr((sTelephone), _
Cstr(sClient_Name),Cstr(sTopic), _
Cstr(sExpires),Cstr(sHours))
That will not help if the parameters are modified by the DLL.
You may have to add a new function to recieve Variants.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top