Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. COM givin problem in ASP

COM givin problem in ASP

Scheduled Pinned Locked Moved COM
helpcomregexquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    asif m hmood
    wrote on last edited by
    #1

    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????

    D M 2 Replies Last reply
    0
    • A asif m hmood

      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????

      D Offline
      D Offline
      darkbyte
      wrote on last edited by
      #2

      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 ?

      A 1 Reply Last reply
      0
      • D darkbyte

        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 ?

        A Offline
        A Offline
        asif m hmood
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • A asif m hmood

          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.

          D Offline
          D Offline
          darkbyte
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A asif m hmood

            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????

            M Offline
            M Offline
            Milton Karimbekallil
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups