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. variant types..

variant types..

Scheduled Pinned Locked Moved COM
question
6 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    guys i have a variant..being returned by a method..how do i get its vt..and also how do i then extract the value from this variant.. thanks -anand

    I 1 Reply Last reply
    0
    • L Lost User

      guys i have a variant..being returned by a method..how do i get its vt..and also how do i then extract the value from this variant.. thanks -anand

      I Offline
      I Offline
      ian mariano
      wrote on last edited by
      #2

      If v is the variable the VARIANT is returned in, then v.vt is the type (VARTYPE) VARIANT and VARIANTARG

      Ian Mariano - http://www.ian-space.com/
      "We are all wave equations in the information matrix of the universe" - me

      S 1 Reply Last reply
      0
      • I ian mariano

        If v is the variable the VARIANT is returned in, then v.vt is the type (VARTYPE) VARIANT and VARIANTARG

        Ian Mariano - http://www.ian-space.com/
        "We are all wave equations in the information matrix of the universe" - me

        S Offline
        S Offline
        safee ullah
        wrote on last edited by
        #3

        hey thanks ian.. one more thing plz..how do i then get the value from this variant? thanks

        S 1 Reply Last reply
        0
        • S safee ullah

          hey thanks ian.. one more thing plz..how do i then get the value from this variant? thanks

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          Depends what it is. There are various macros beginning V_ that you might find useful. Say you have VARIANT v; HRESULT x = myobj.mycall(...,...,..., &v); You can have code like this: switch(V_VT(&v)) { case VT_BSTR: // Returned a string // V_BSTR(&v) is the BSTR being passed back... break; case VT_I4: // Returned a 'long' // V_I4(&v) is the number and so on. Does that help? Steve S

          I 1 Reply Last reply
          0
          • S Steve S

            Depends what it is. There are various macros beginning V_ that you might find useful. Say you have VARIANT v; HRESULT x = myobj.mycall(...,...,..., &v); You can have code like this: switch(V_VT(&v)) { case VT_BSTR: // Returned a string // V_BSTR(&v) is the BSTR being passed back... break; case VT_I4: // Returned a 'long' // V_I4(&v) is the number and so on. Does that help? Steve S

            I Offline
            I Offline
            ian mariano
            wrote on last edited by
            #5

            Dang! You beat me to it ;)

            Ian Mariano - http://www.ian-space.com/
            "We are all wave equations in the information matrix of the universe" - me

            L 1 Reply Last reply
            0
            • I ian mariano

              Dang! You beat me to it ;)

              Ian Mariano - http://www.ian-space.com/
              "We are all wave equations in the information matrix of the universe" - me

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Thanks a lot people... :D

              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