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. C / C++ / MFC
  4. Error in BSTR TagVariant After project Migration from VS2010 to VS2017

Error in BSTR TagVariant After project Migration from VS2010 to VS2017

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 Posts 3 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.
  • U Offline
    U Offline
    User 13229093
    wrote on last edited by
    #1

    **Error in line :

    CString sURL = URL->bstrVal;

    //bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]

    V CPalliniC 2 Replies Last reply
    0
    • U User 13229093

      **Error in line :

      CString sURL = URL->bstrVal;

      //bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      try

      CString sURL = (LPCTSTR)(_bstr_t)URL->bstrVal;

      1 Reply Last reply
      0
      • U User 13229093

        **Error in line :

        CString sURL = URL->bstrVal;

        //bstrVal is BSTR TagVariant Error is** error C2440: 'initializing': cannot convert from 'BSTR' to 'ATL::CStringT>>' 1> with 1> [ 1> _CharType=char 1> ] 1>note: Constructor for class 'ATL::CStringT>>' is declared 'explicit' 1> with 1> [ 1> _CharType=char 1> ]

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Did you preserve the project Character Set value in the migration process?

        Quote:

        _CharType=char

        is an hint a "Not Set" or "Use Multi-Byte Character Set" is selected, while "Use Unicode Character Set" would be possiby more appropriate.

        In testa che avete, signor di Ceprano?

        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