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. Typecast _bstr_t to int?

Typecast _bstr_t to int?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • H Offline
    H Offline
    hanno25
    wrote on last edited by
    #1

    Hi! is it possible, to make a castType from _bstr_t to "int"? Thanks, hanno

    D W 2 Replies Last reply
    0
    • H hanno25

      Hi! is it possible, to make a castType from _bstr_t to "int"? Thanks, hanno

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Can't you just use atoi()?


      "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

      "There is no death, only a change of worlds." - Native American Proverb

      1 Reply Last reply
      0
      • H hanno25

        Hi! is it possible, to make a castType from _bstr_t to "int"? Thanks, hanno

        W Offline
        W Offline
        walter76
        wrote on last edited by
        #3

        Don't know what you like to achieve, but if you are up to put a integer value into a string a type cast is the wrong way. Use atoi() to convert character arrays to integers. Hope this helped you out. Walter

        H 1 Reply Last reply
        0
        • W walter76

          Don't know what you like to achieve, but if you are up to put a integer value into a string a type cast is the wrong way. Use atoi() to convert character arrays to integers. Hope this helped you out. Walter

          H Offline
          H Offline
          hanno25
          wrote on last edited by
          #4

          Yes, that did it! Thanks.

          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