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

CString problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
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.
  • M Offline
    M Offline
    MFC is the Best
    wrote on last edited by
    #1

    Hi! i have a dialogbased mfc-programm. in this programm i have several cstrings like 155 180 210 .......... with a lot of rows and columns. now i want to have every number as a single integer. like int One=155; int Two=180;..... is it possible??? thanks for every reply. MFC

    M 1 Reply Last reply
    0
    • M MFC is the Best

      Hi! i have a dialogbased mfc-programm. in this programm i have several cstrings like 155 180 210 .......... with a lot of rows and columns. now i want to have every number as a single integer. like int One=155; int Two=180;..... is it possible??? thanks for every reply. MFC

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

      Use AfxExtractSubString() to pull out each group of digits, then _ttoi() to convert to integers. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

      M 1 Reply Last reply
      0
      • M Michael Dunn

        Use AfxExtractSubString() to pull out each group of digits, then _ttoi() to convert to integers. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        M Offline
        M Offline
        MFC is the Best
        wrote on last edited by
        #3

        i searched the function AfxExtractSubString in the msdn, but i found nothing. :confused: can you explain the use? :~ my string is called: CString text; and it contains for example: 120 111 34 44 (between every number is a blank) thanks MFC

        J 1 Reply Last reply
        0
        • M MFC is the Best

          i searched the function AfxExtractSubString in the msdn, but i found nothing. :confused: can you explain the use? :~ my string is called: CString text; and it contains for example: 120 111 34 44 (between every number is a blank) thanks MFC

          J Offline
          J Offline
          jhwurmbach
          wrote on last edited by
          #4

          MFC is the Best wrote: 120 111 34 44 (between every number is a blank) Why dont you just simply use CString::Find(' ', nStart) ? So you can iterate over the whole Line and by remembering the result of Find() you can reuse it in the next Find(). With CString::Mid(), you get the portion of the Text between the two finds.

          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