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. CString to int..problem

CString to int..problem

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

    i am using this to convert my CString variable to int type.....can anybody help me what went wrong it is not working..... ASSERT(_tcstoul(db_TQuote.m_MarketName == _ttoi(Market))); ASSERT(_tcstoul(db_TQuote.m_MarketState == _ttoi(marketstate)); ASSERT(_tcstoul(db_TQuote.m_Ask == _ttoi(ask_d)); ASSERT(_tcstoul(db_TQuote.m_Bid== _ttoi(bid_d)); ASSERT(_tcstoul(db_TQuote.m_DateTimeStamp== _ttoi(timestamp)); ASSERT(_tcstoul(db_TQuote.m_MarketNo== _ttoi(marketno))

    P M S 3 Replies Last reply
    0
    • W With_problem

      i am using this to convert my CString variable to int type.....can anybody help me what went wrong it is not working..... ASSERT(_tcstoul(db_TQuote.m_MarketName == _ttoi(Market))); ASSERT(_tcstoul(db_TQuote.m_MarketState == _ttoi(marketstate)); ASSERT(_tcstoul(db_TQuote.m_Ask == _ttoi(ask_d)); ASSERT(_tcstoul(db_TQuote.m_Bid== _ttoi(bid_d)); ASSERT(_tcstoul(db_TQuote.m_DateTimeStamp== _ttoi(timestamp)); ASSERT(_tcstoul(db_TQuote.m_MarketNo== _ttoi(marketno))

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      What are you doing ?

      abrakadbra wrote:

      ASSERT(_tcstoul(db_TQuote.m_MarketName == _ttoi(Market)));

      What is datatype of Market ? I'm assuming it is string. What is db_TQuote.m_MarketName ? Input to _tcstoul will be bool instead of string as expected. This code should not compile in first place.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      • W With_problem

        i am using this to convert my CString variable to int type.....can anybody help me what went wrong it is not working..... ASSERT(_tcstoul(db_TQuote.m_MarketName == _ttoi(Market))); ASSERT(_tcstoul(db_TQuote.m_MarketState == _ttoi(marketstate)); ASSERT(_tcstoul(db_TQuote.m_Ask == _ttoi(ask_d)); ASSERT(_tcstoul(db_TQuote.m_Bid== _ttoi(bid_d)); ASSERT(_tcstoul(db_TQuote.m_DateTimeStamp== _ttoi(timestamp)); ASSERT(_tcstoul(db_TQuote.m_MarketNo== _ttoi(marketno))

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

        See the FAQ 6.3 How can I change a number into its string representation, or vice versa?[^]

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

        1 Reply Last reply
        0
        • W With_problem

          i am using this to convert my CString variable to int type.....can anybody help me what went wrong it is not working..... ASSERT(_tcstoul(db_TQuote.m_MarketName == _ttoi(Market))); ASSERT(_tcstoul(db_TQuote.m_MarketState == _ttoi(marketstate)); ASSERT(_tcstoul(db_TQuote.m_Ask == _ttoi(ask_d)); ASSERT(_tcstoul(db_TQuote.m_Bid== _ttoi(bid_d)); ASSERT(_tcstoul(db_TQuote.m_DateTimeStamp== _ttoi(timestamp)); ASSERT(_tcstoul(db_TQuote.m_MarketNo== _ttoi(marketno))

          S Offline
          S Offline
          S Douglas
          wrote on last edited by
          #4

          Once you get your conversion issue worked out (follow the advice of the other posters) take a look at this thread. ASSERT[^]


          I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:

          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