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

Using a dll in ASP 1

Status
Not open for further replies.

newprogrammer999

Programmer
Aug 28, 2002
26
IE
Hi everyone,

I have a vb program and an asp application that access the same dll file. The both send some values to the dll file, some calculations are done and the new values are returned. With the vb progam the types are defined in the dll file as int or double but for asp they are not. My problem is the values being returned using asp are slightly different to the vb ones. I think this is something to do with values in asp being passed as variants while the are passed in vb as int or doubles.

Can anyone tell me how to get the same values returned form both applications.

Regards,
benny
 
You're saying that the values you are passing to the dll file from ASP are being passed as variants and the dll file is expecting int or double? If so, then the solution in ASP would be when sending the values to first convert them.

dim firstVar, secondVar
firstVar = cint(request.form("testvalue"))
secondVar = cdbl(request.form("testvalue2"))
call objDLL.clsTest(firstVar, secondVar)

You simply convert the values before you pass them to the dll component. Hope this answers your question. If not, please clarify your question. :)

Everything is absolute. Everything else is relative.
 
Yeah that should sort the problem out. Sorry about the delay in replying - the email notification didn't seem to work!

Regards
benny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top