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. Help~~~

Help~~~

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

    What's the relation of ComBStr, _bstr_t, BStr??

    A M J 3 Replies Last reply
    0
    • H HuizhiZhao

      What's the relation of ComBStr, _bstr_t, BStr??

      A Offline
      A Offline
      anu_88
      wrote on last edited by
      #2

      See this www.devguy.com/fp/Tips/COM/bstr.htm[^] Hope this will help

      H 1 Reply Last reply
      0
      • H HuizhiZhao

        What's the relation of ComBStr, _bstr_t, BStr??

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        H 1 Reply Last reply
        0
        • H HuizhiZhao

          What's the relation of ComBStr, _bstr_t, BStr??

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          In short: CComBSTR is a thin wrapper around the BSTR API, while _bstr_t is a rather thick one. By thick I mean that it wraps associated HRESULTs into exceptions. _bstr_t is more suitable for applications, in which it's almost always possible to throw exceptions across calls. In certain scenarios however, such as in COM components, it's not advisable to do that because of threading/apartment issues (it's downright dangerous!). In such scenarios, CComBSTR is far better suitable, as it does not throw exceptions. :)

          -- Mr. Bender's Wardrobe by ROBOTANY 500

          H 1 Reply Last reply
          0
          • A anu_88

            See this www.devguy.com/fp/Tips/COM/bstr.htm[^] Hope this will help

            H Offline
            H Offline
            HuizhiZhao
            wrote on last edited by
            #5

            Thank you~~~

            1 Reply Last reply
            0
            • M Michael Dunn

              The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

              H Offline
              H Offline
              HuizhiZhao
              wrote on last edited by
              #6

              Thank you~~

              1 Reply Last reply
              0
              • J Jorgen Sigvardsson

                In short: CComBSTR is a thin wrapper around the BSTR API, while _bstr_t is a rather thick one. By thick I mean that it wraps associated HRESULTs into exceptions. _bstr_t is more suitable for applications, in which it's almost always possible to throw exceptions across calls. In certain scenarios however, such as in COM components, it's not advisable to do that because of threading/apartment issues (it's downright dangerous!). In such scenarios, CComBSTR is far better suitable, as it does not throw exceptions. :)

                -- Mr. Bender's Wardrobe by ROBOTANY 500

                H Offline
                H Offline
                HuizhiZhao
                wrote on last edited by
                #7

                Thank you~

                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