COM givin problem in ASP
-
i have used [in,out] in my COM method but when i call my method from ASP it gives error "Type mismatch: methodname" . i have also used CInt() for my int variables , but now it shows nothin when i respons.write my variable. e.g In COM power([in]int num,[in] int pNum,[in,out] int *res) In ASP , i calling it myObj.power num1,num2,CInt(num3) 'this gets nothin in num3 if i go like that myObj.power num1,num2,num3 'gives error Type Mis-match:power aby idea abt this????
-
i have used [in,out] in my COM method but when i call my method from ASP it gives error "Type mismatch: methodname" . i have also used CInt() for my int variables , but now it shows nothin when i respons.write my variable. e.g In COM power([in]int num,[in] int pNum,[in,out] int *res) In ASP , i calling it myObj.power num1,num2,CInt(num3) 'this gets nothin in num3 if i go like that myObj.power num1,num2,num3 'gives error Type Mis-match:power aby idea abt this????
Ok, just making sure here: The reason you make it [in,out] is because you provide some information and expect possible different information back, right ? If not, if all you want is to return a value, you should use [out] only, althought for int values it shouldnt make much of a difference. If you return only 1 value, i suggest you use [out, retval], in which case, you can assign to a variable like: var = myObj.power(num1, num2). If you use CInt(num3), ASP actually creates a new, invisible, variable to store the conversion and your returned value isnt accessible, even if it is actually returned somewhere. what you might also need is the equivalent of addressof(var), or &var in your script engine. so you might have to do something like myObj.power num1, num2, addressof(num3). I'm not sure exactly if this is a requirement but i expose it just in case. by the way, which scripting language are you using ? VBScript or JavaScript ?
-
Ok, just making sure here: The reason you make it [in,out] is because you provide some information and expect possible different information back, right ? If not, if all you want is to return a value, you should use [out] only, althought for int values it shouldnt make much of a difference. If you return only 1 value, i suggest you use [out, retval], in which case, you can assign to a variable like: var = myObj.power(num1, num2). If you use CInt(num3), ASP actually creates a new, invisible, variable to store the conversion and your returned value isnt accessible, even if it is actually returned somewhere. what you might also need is the equivalent of addressof(var), or &var in your script engine. so you might have to do something like myObj.power num1, num2, addressof(num3). I'm not sure exactly if this is a requirement but i expose it just in case. by the way, which scripting language are you using ? VBScript or JavaScript ?
Yes , u r right, i want to provide some info to method and get processed info from method. i have used [out,retval] , it works fine but i want to get multiple variables out of method that's y using [in,out]. i m using VB Script. well is there any addressof(var) operator exists in VB script. if so do tell me or any equivalent function to do this.
-
Yes , u r right, i want to provide some info to method and get processed info from method. i have used [out,retval] , it works fine but i want to get multiple variables out of method that's y using [in,out]. i m using VB Script. well is there any addressof(var) operator exists in VB script. if so do tell me or any equivalent function to do this.
Hmmmmm, VBScript... Ok, do you declare your variables before using them ? Dim num3 as Integer myObj.power 2, 3, num3 this should theoreticly work. Reason should be, if you dont declare your variable, the variable is defined as type Variant which is not what myObj.power expects.
-
i have used [in,out] in my COM method but when i call my method from ASP it gives error "Type mismatch: methodname" . i have also used CInt() for my int variables , but now it shows nothin when i respons.write my variable. e.g In COM power([in]int num,[in] int pNum,[in,out] int *res) In ASP , i calling it myObj.power num1,num2,CInt(num3) 'this gets nothin in num3 if i go like that myObj.power num1,num2,num3 'gives error Type Mis-match:power aby idea abt this????
hi If u want to return a value back to asp from an interface method, that variable shud b of type
VARIANT
type. There is no other go. So the IDL shuld be[in, out] VARIANT *pOut1, [in, out] VARIANT *pOut2, ..., ...
for all the variables u need to return a value back to asp. This way u can have any number of in-out parameters for an interface method. rgds.. mil10