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. About the size of CString

About the size of CString

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

    Hello every body i try to put mor than 256 char in the CString viriable but i cannot, any help. Best Regards :)

    D M A N 4 Replies Last reply
    0
    • D Drawil

      Hello every body i try to put mor than 256 char in the CString viriable but i cannot, any help. Best Regards :)

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

      Can you provide a code snippet of how you are doing this?

      D 1 Reply Last reply
      0
      • D Drawil

        Hello every body i try to put mor than 256 char in the CString viriable but i cannot, any help. Best Regards :)

        M Offline
        M Offline
        Martyn Pearson
        wrote on last edited by
        #3

        The MFC CString will accommodate strings far longer than 256 characters. It is more likely that there is something wrong with the code that is populating the CString. Post the code if you still have problems! :)

        1 Reply Last reply
        0
        • D David Crow

          Can you provide a code snippet of how you are doing this?

          D Offline
          D Offline
          Drawil
          wrote on last edited by
          #4

          CString query; query=_T("select distinct globalt.Mkname,globalt.Route,globalt.Time,globalt.SI,globalt.NDV,globalt.ANBLO,Avg(globalt.Traff) AS AvgTraffic,Avg( globalt.CCONG) AS AvgCCONG \n" "from globalt \n" "where ((([globalt].[Route]) Like '*SS*' Or ([globalt].[Route]) Like '*I')=False"); Best Regards :)

          D 1 Reply Last reply
          0
          • D Drawil

            CString query; query=_T("select distinct globalt.Mkname,globalt.Route,globalt.Time,globalt.SI,globalt.NDV,globalt.ANBLO,Avg(globalt.Traff) AS AvgTraffic,Avg( globalt.CCONG) AS AvgCCONG \n" "from globalt \n" "where ((([globalt].[Route]) Like '*SS*' Or ([globalt].[Route]) Like '*I')=False"); Best Regards :)

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

            There's only 254 characters there. What's the problem?

            D 2 Replies Last reply
            0
            • D Drawil

              Hello every body i try to put mor than 256 char in the CString viriable but i cannot, any help. Best Regards :)

              A Offline
              A Offline
              Alexandru Savescu
              wrote on last edited by
              #6

              Use the Format method:

              CString s;
              s.Format ("A very long string");

              Best regards, Alexandru Savescu P.S. Interested in art? Visit this!

              1 Reply Last reply
              0
              • D Drawil

                Hello every body i try to put mor than 256 char in the CString viriable but i cannot, any help. Best Regards :)

                N Offline
                N Offline
                NHM
                wrote on last edited by
                #7

                the code u posted works just fine...:cool:

                1 Reply Last reply
                0
                • D David Crow

                  There's only 254 characters there. What's the problem?

                  D Offline
                  D Offline
                  Drawil
                  wrote on last edited by
                  #8

                  Thank u for ur reply I know every thing appeares normal in my code, but after this step if watch this variable 'query' it equals: "select distinct globalt.Mkname,globalt.Route,globalt.Time,globalt.SI,globalt.NDV,globalt.ANBLO,Avg(globalt.Traff) AS AvgTraffic,Avg( globalt.CCONG) AS AvgCCONG from globalt where ((([globalt].[Route]) Like '*SS*' Or ([globalt].[Route]) Like '*I')=Fal" as u see some char doesnot included "se", even if i add more strings to this variable like query+="any thing" then it doesnt appeare. so this is my problem!!!! Best Regards :)

                  1 Reply Last reply
                  0
                  • D David Crow

                    There's only 254 characters there. What's the problem?

                    D Offline
                    D Offline
                    Drawil
                    wrote on last edited by
                    #9

                    hi again yes that is right :) there is no problem with CString. the problem was in the Watch window which could not show all char in CString. Best Regards :)

                    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