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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VS.NET _bstr_t flawed?

VS.NET _bstr_t flawed?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiohelpquestionannouncement
1 Posts 1 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.
  • M Offline
    M Offline
    mstephens
    wrote on last edited by
    #1

    Is it me or is the latest implementation of the _bstr_t class flawed in Visual Studio .NET? I have a class that has an internal member of type _bstr_t. During construction the _bstr_t classes default constructor runs and sets it's internal m_Data pointer to NULL. Later i call a function with a BSTR parameter and use the _bstr_t::Assign method to copy the BSTR into my member variable. Under VS6 this code was fine but under VS.NET it crashes. The reason for the crash is in an ASSERT where the expression is something like (m_Data->GetWString() != s) since m_Data is NULL it crashes! Since it's in an assertion i can compile to a release build and it works ok. Has anyone else seen this and is there any kind of service pack for VS.NET that fixes the problem?

    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