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. Convert Integer to CString

Convert Integer to CString

Scheduled Pinned Locked Moved C / C++ / MFC
helpdata-structures
13 Posts 7 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.
  • P Offline
    P Offline
    phanindra varma
    wrote on last edited by
    #1

    hello, i have one integer array....{1,12,3,64,555} i need to convert each integer as "CString" i try to use Format() like ex: CString str; int i=0; str.Format("%d",i); It wasa giving an Error. Can any one help me in this regard. Thanks in advance....!!!!!:rose:

    M R D 3 Replies Last reply
    0
    • P phanindra varma

      hello, i have one integer array....{1,12,3,64,555} i need to convert each integer as "CString" i try to use Format() like ex: CString str; int i=0; str.Format("%d",i); It wasa giving an Error. Can any one help me in this regard. Thanks in advance....!!!!!:rose:

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

      I can't see anything wrong with this code. What error are you getting?

      1 Reply Last reply
      0
      • P phanindra varma

        hello, i have one integer array....{1,12,3,64,555} i need to convert each integer as "CString" i try to use Format() like ex: CString str; int i=0; str.Format("%d",i); It wasa giving an Error. Can any one help me in this regard. Thanks in advance....!!!!!:rose:

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        phanindra varma wrote:

        str.Format("%d",i);

        Are you doing a fully Unicode build? Are you missing the _T macro? Have you tried: str.Format(_T("%d"),i); instead?

        Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

        M P 2 Replies Last reply
        0
        • R Rajesh R Subramanian

          phanindra varma wrote:

          str.Format("%d",i);

          Are you doing a fully Unicode build? Are you missing the _T macro? Have you tried: str.Format(_T("%d"),i); instead?

          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

          M Offline
          M Offline
          Michael Schubert
          wrote on last edited by
          #4

          That's pretty much the only explanation for this code to fail...

          1 Reply Last reply
          0
          • P phanindra varma

            hello, i have one integer array....{1,12,3,64,555} i need to convert each integer as "CString" i try to use Format() like ex: CString str; int i=0; str.Format("%d",i); It wasa giving an Error. Can any one help me in this regard. Thanks in advance....!!!!!:rose:

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

            phanindra varma wrote:

            It wasa giving an Error.

            Turn your monitor around so we can see it. :rolleyes:

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            M R H 3 Replies Last reply
            0
            • D David Crow

              phanindra varma wrote:

              It wasa giving an Error.

              Turn your monitor around so we can see it. :rolleyes:

              "Love people and use things, not love things and use people." - Unknown

              "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

              M Offline
              M Offline
              Michael Schubert
              wrote on last edited by
              #6

              :laugh: :laugh:

              1 Reply Last reply
              0
              • R Rajesh R Subramanian

                phanindra varma wrote:

                str.Format("%d",i);

                Are you doing a fully Unicode build? Are you missing the _T macro? Have you tried: str.Format(_T("%d"),i); instead?

                Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                P Offline
                P Offline
                phanindra varma
                wrote on last edited by
                #7

                Thanks..... I forget _T(); Thanks again.. because Even for this silly question also u r guided me in a rigtt way.... Bye....

                R V 2 Replies Last reply
                0
                • D David Crow

                  phanindra varma wrote:

                  It wasa giving an Error.

                  Turn your monitor around so we can see it. :rolleyes:

                  "Love people and use things, not love things and use people." - Unknown

                  "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #8

                  :laugh: How much I love your comments.

                  Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                  T 1 Reply Last reply
                  0
                  • D David Crow

                    phanindra varma wrote:

                    It wasa giving an Error.

                    Turn your monitor around so we can see it. :rolleyes:

                    "Love people and use things, not love things and use people." - Unknown

                    "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #9

                    :laugh: You have powrful eyes. :-D

                    1 Reply Last reply
                    0
                    • P phanindra varma

                      Thanks..... I forget _T(); Thanks again.. because Even for this silly question also u r guided me in a rigtt way.... Bye....

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      That's fine, but please make sure that you provide all the necessary information with your query, so that it would be easier for others to help you. You said there was an error, but did not say what it was. Take care of these things in the future.

                      Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                      P 1 Reply Last reply
                      0
                      • P phanindra varma

                        Thanks..... I forget _T(); Thanks again.. because Even for this silly question also u r guided me in a rigtt way.... Bye....

                        V Offline
                        V Offline
                        vijay_aroli
                        wrote on last edited by
                        #11

                        In addition to what Rajesh said, I would also advice you not to use SMS text while posting messages here. :)

                        Regards, Vijay.

                        1 Reply Last reply
                        0
                        • R Rajesh R Subramanian

                          :laugh: How much I love your comments.

                          Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

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

                          Rajesh R Subramanian wrote:

                          How much I love your comments.

                          :-D

                          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                          Never mind - my own stupidity is the source of every "problem" - Mixture

                          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>

                          1 Reply Last reply
                          0
                          • R Rajesh R Subramanian

                            That's fine, but please make sure that you provide all the necessary information with your query, so that it would be easier for others to help you. You said there was an error, but did not say what it was. Take care of these things in the future.

                            Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                            P Offline
                            P Offline
                            phanindra varma
                            wrote on last edited by
                            #13

                            O.k Thanks for the Suggestion !!!!!

                            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