Please Help me.I am trying to over come this paoblem from last 2 days But i am not able to overcome.
I was able to set up the environment so that I can call .NET method (via COM) from a classic ASP page.
Everything actually works as intended until when I have to call a .NET method that requires a .NET type.
So I have a method named SetTable Like Below
I have a function like this in .Net
Public Sub SetTable(ByVal _City As City, ByVal _Country As Country)
'doing some thing
End Sub
and i have asp code like this:
dim CountryUtil, City, Country
set CountryUtil= Server.CreateObject("mydll.CountryUtil")
set City= Server.CreateObject("mydll.City")
set Country = Server.CreateObject("mydll.Country")
city.id= 123
city.property = "so and so"
Country.id= 123
Country.property = "so and so"
CountryUtil.SetTable(City, Country)
' I get this error here:
'Microsoft VBScript runtime error '800a0005' 'Invalid procedure call or argument: 'SetTable'
Thanks in advance.
in vbscript you only have variants so Country and City are just objects of type variant not of type Country or City.
you will have to change the .net method SetTable (or write a new one) which accepts "variants" (object) and then cast those objects to your .net City and Country objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With