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. Using += with CString - problem

Using += with CString - problem

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
5 Posts 5 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.
  • R Offline
    R Offline
    richiebabes
    wrote on last edited by
    #1

    I am having major problems adding strings to the end of a CString with +=. Instead of just copying in the text I get a load of ganumph at the end of the string I don't want - e.g. here is one line of text that was produced - ÍÍÍÍÍÍÍÍÍÍýýýý««««««««îþîþ. Why do I get all this rubbish at the end? How do I get rid of it?

    T V I 3 Replies Last reply
    0
    • R richiebabes

      I am having major problems adding strings to the end of a CString with +=. Instead of just copying in the text I get a load of ganumph at the end of the string I don't want - e.g. here is one line of text that was produced - ÍÍÍÍÍÍÍÍÍÍýýýý««««««««îþîþ. Why do I get all this rubbish at the end? How do I get rid of it?

      T Offline
      T Offline
      Ted Ferenc
      wrote on last edited by
      #2

      Is the string you are adding NULL terminated? as a test set the last location of the string you are adding to NULL


      "Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it." - Cullen Hightower

      1 Reply Last reply
      0
      • R richiebabes

        I am having major problems adding strings to the end of a CString with +=. Instead of just copying in the text I get a load of ganumph at the end of the string I don't want - e.g. here is one line of text that was produced - ÍÍÍÍÍÍÍÍÍÍýýýý««««««««îþîþ. Why do I get all this rubbish at the end? How do I get rid of it?

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        Post an example including the declaration, instantiation, and concatenation of the CString object. Kuphryn

        1 Reply Last reply
        0
        • R richiebabes

          I am having major problems adding strings to the end of a CString with +=. Instead of just copying in the text I get a load of ganumph at the end of the string I don't want - e.g. here is one line of text that was produced - ÍÍÍÍÍÍÍÍÍÍýýýý««««««««îþîþ. Why do I get all this rubbish at the end? How do I get rid of it?

          I Offline
          I Offline
          includeh10
          wrote on last edited by
          #4

          problem is in your code somewhere, CString is OK. only thing which may cause trouble is operator = of CString cheers includeh10

          T 1 Reply Last reply
          0
          • I includeh10

            problem is in your code somewhere, CString is OK. only thing which may cause trouble is operator = of CString cheers includeh10

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            hain i didn't think soo. i know csting is most persistent calss in vc++. pls give me your exact problem i will see to it and post reply thanks I Think It will Work Alok Gupta visit me at http://www.thisisalok.tk

            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