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. SAFEARRAY in Variant

SAFEARRAY in Variant

Scheduled Pinned Locked Moved COM
tutorial
2 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.
  • H Offline
    H Offline
    Hans Ruck
    wrote on last edited by
    #1

    I pass a SAFEARRAY through a Variant in VB. Now i have the Variant and i don't know how to extract the SAFEARRAY from it. rechi

    R 1 Reply Last reply
    0
    • H Hans Ruck

      I pass a SAFEARRAY through a Variant in VB. Now i have the Variant and i don't know how to extract the SAFEARRAY from it. rechi

      R Offline
      R Offline
      Ramu Pulipati
      wrote on last edited by
      #2

      STDMETHODIMPL MyCOMClass::VBMethod(VARIANT * vt) { SAFEARRAY *psa; if(vt == NULL) return E_POINTER; //assuming safearray consists BSTR. if not change to appropriate sa datatype if(vt->vt != VT_BSTR | VT_ARRAY) { return E_INVALIDARG; } psa = vt->parray; ATLASSERT(psa != NULL); //use safe array here return S_OK; } Hth, Ramu

      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