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. Trouble with _variant_t

Trouble with _variant_t

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 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.
  • Y Offline
    Y Offline
    yanuart
    wrote on last edited by
    #1

    I get this error [code]error C2664: '_variant_t::_variant_t(VARIANT &,bool)' : cannot convert parameter 1 from 'const char [5]' to 'VARIANT &'[/code] when I tried to create a new variant using this code : [code]_variant_t varID("myID", VT_BSTR);[/code] what's wrong ?? as the docs says its okay

    M 1 Reply Last reply
    0
    • Y yanuart

      I get this error [code]error C2664: '_variant_t::_variant_t(VARIANT &,bool)' : cannot convert parameter 1 from 'const char [5]' to 'VARIANT &'[/code] when I tried to create a new variant using this code : [code]_variant_t varID("myID", VT_BSTR);[/code] what's wrong ?? as the docs says its okay

      M Offline
      M Offline
      Milton Karimbekallil
      wrote on last edited by
      #2

      hi There is no default constructor for _variant_t that takes the 'value' and 'VT_BSTR' 2gethor... Simply give the value only. So change ur code with the following. _variant_t varID(L"myID"); rgds..mil10

      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