Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing ASP Parameters to a VFP COM DLL
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00303820
Message ID:
00304246
Views:
26
We come across this same problem in VB COM components. Remember that all variables in VBScript are Variants so their types can get whacked when passing them as parameters. Try wrapping your variables in the appropriate typecasting function. In your case try CLng(FirstNumber) and CLng(SecondNumber).

>Hi:
>
>I'm using W2000 Professional and IIS 5.0. Currently I'm unable to pass ASP "form elements" to my VFP COM DLL. For example:
>
>{VB Script Code}
>SET oCalculate = server.CREATEOBJECT("SquareNumbers.Generate")
>FirstNumber = REQUEST.FORM("FirstNumber")
>SecondNumber = REQUEST.FORM("SecondNumber")
>MyResult = oCalculate.HowManySquareUnits(FirstNumber,SecondNumber)
>
>This is a simple DLL that just calculates the square of two numbers--I'm learning to crawl here with ASP and VFP COM :-)
>
>In my VFP Error event I get a "data type mismatch" when I multiply the two parameters together:
>
>FUNCTION HowManySquareUnits
> LPARAMETERS FirstNo,SecondNo
>
> LOCAL lnResult
>
> lnResult = FirstNo*secondNo && It errors here!--the data types are Logical
>
> RETURN lnResult
>ENDFUNC
>
>The real funny thing is that if I pass literals it works!
>MyResult = oCalculate.HowManySquareUnits(123,456) This works!
>
>What am I doing wrong here?
>
>Thanks for all your input, and for all the other responses regarding my previous question with the "File Access Denied"--all of your responses were very helpful!
>
>--Paul
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform