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. Visual Basic
  4. extracting safearray from a variant

extracting safearray from a variant

Scheduled Pinned Locked Moved Visual Basic
c++databasetutorial
3 Posts 2 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
    Anonymous
    wrote on last edited by
    #1

    ok, I'm just starting to learn how to pass more complicated things from my C++ objects to vb (which I'm just starting to learn). Currently I can't seem to figure out how to get my safearray out of the variant passed through my callback interface. This safearray needs to be passed back through a callback interface ACROSS process boundaries (no passing by ref allowed). _____________________________________ the C++ side of this is as follows SAFEARRAY *saHashCodes; saHashCodes = SafeArrayCreateVector( VT_I4, 0, nNumHashCodes ); for ( U32 index = 0; index

    V 1 Reply Last reply
    0
    • A Anonymous

      ok, I'm just starting to learn how to pass more complicated things from my C++ objects to vb (which I'm just starting to learn). Currently I can't seem to figure out how to get my safearray out of the variant passed through my callback interface. This safearray needs to be passed back through a callback interface ACROSS process boundaries (no passing by ref allowed). _____________________________________ the C++ side of this is as follows SAFEARRAY *saHashCodes; saHashCodes = SafeArrayCreateVector( VT_I4, 0, nNumHashCodes ); for ( U32 index = 0; index

      V Offline
      V Offline
      Vi2
      wrote on last edited by
      #2

      You should also specify the VT_I4 var.vt = VT_ARRAY | VT_I4; In ServerLink_ReturnPrivateHashList function you can have your array in "saHashArray" parameter. It will be the array of Long (not Integer!) values. You can obtain any value from him Dim i As Long i = saHashArray(0) ' or i = saHashArray(x), where x = 0,...,nNumHashCodes-1 ' or i = saHashArray(x), where x = LBound(saHashArray),...,UBound(saHashArray) Or you can obtain whole array, but it's the same in it's usage Dim arr() As Long arr = saHashArray With best wishes, Vita

      A 1 Reply Last reply
      0
      • V Vi2

        You should also specify the VT_I4 var.vt = VT_ARRAY | VT_I4; In ServerLink_ReturnPrivateHashList function you can have your array in "saHashArray" parameter. It will be the array of Long (not Integer!) values. You can obtain any value from him Dim i As Long i = saHashArray(0) ' or i = saHashArray(x), where x = 0,...,nNumHashCodes-1 ' or i = saHashArray(x), where x = LBound(saHashArray),...,UBound(saHashArray) Or you can obtain whole array, but it's the same in it's usage Dim arr() As Long arr = saHashArray With best wishes, Vita

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        excellent, it worked like a champ! 3 books, 2 newsgroups and about 4 irc channels later your the first person that could answer that. I really appreciate the help!

        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