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. BSTR or Structure ?

BSTR or Structure ?

Scheduled Pinned Locked Moved COM
tutorialcomdesignquestion
2 Posts 1 Posters 2 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

    I have to pass a lot of parameters to and from my COM in one function. What would the better to use a BSTR string or to pack them into a structure? If a structure, could anyone sent an example how to use a pointer to the structure in IDL design. Thanks.

    L 1 Reply Last reply
    0
    • L Lost User

      I have to pass a lot of parameters to and from my COM in one function. What would the better to use a BSTR string or to pack them into a structure? If a structure, could anyone sent an example how to use a pointer to the structure in IDL design. Thanks.

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

      Hi, You have an option of passing all the parameters as SafeArray of bytes or you can use the wrapper COM object for the parameters. The second approach is much easier to use but it cost time to create/destroy extra object. As for me if I don't call the function too often I prefer to use a special object for passing parameters. There is an article in MSDN "OLE Q&A" by Don BOX which has more details on the topic... Regards, Alex Gorev, Dundas Software.

      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