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????-newbie

CString????-newbie

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

    Hi again buddies Can anyone help me with a couple of questions on CString i'm trying to use it for the first time CString str("Ma%");//CString' : undeclared identifier(i include string) also how can i convert a string to CString and vice versa Thanks a lot

    T S 3 Replies Last reply
    0
    • A antonaras

      Hi again buddies Can anyone help me with a couple of questions on CString i'm trying to use it for the first time CString str("Ma%");//CString' : undeclared identifier(i include string) also how can i convert a string to CString and vice versa Thanks a lot

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      CString is a MFC (or ATL) class. if you don't have a MFC project, you won't see it. did you create a console project ?


      TOXCCT >>> GEII power

      [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

      1 Reply Last reply
      0
      • A antonaras

        Hi again buddies Can anyone help me with a couple of questions on CString i'm trying to use it for the first time CString str("Ma%");//CString' : undeclared identifier(i include string) also how can i convert a string to CString and vice versa Thanks a lot

        S Offline
        S Offline
        Sarath C
        wrote on last edited by
        #3

        U need MFC support for the application. CString is defined at "Afx.h" if add support to for MFC, u can simply use the basic mfc classes. These are the main include files. #include // MFC core and standard components #include // MFC extensions in a normal MFC application, this will be included at "StdAfx.h" SaRath
        "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

        1 Reply Last reply
        0
        • A antonaras

          Hi again buddies Can anyone help me with a couple of questions on CString i'm trying to use it for the first time CString str("Ma%");//CString' : undeclared identifier(i include string) also how can i convert a string to CString and vice versa Thanks a lot

          S Offline
          S Offline
          Sarath C
          wrote on last edited by
          #4

          Converting string to CString string stdStr = "Test"; CString strText = stdStr.c_str(); SaRath
          "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

          A 1 Reply Last reply
          0
          • S Sarath C

            Converting string to CString string stdStr = "Test"; CString strText = stdStr.c_str(); SaRath
            "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

            A Offline
            A Offline
            antonaras
            wrote on last edited by
            #5

            Thanks for the reply Yes i'm doing a console application SARATH can u pls write again the include files that i need to use the code was cut off Thanks again

            T S D 3 Replies Last reply
            0
            • A antonaras

              Thanks for the reply Yes i'm doing a console application SARATH can u pls write again the include files that i need to use the code was cut off Thanks again

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              go to your project settings, add MFC support in it. then, in your files, #include (before all other includes) the file "stdafx.h" which should have been created in your project.


              TOXCCT >>> GEII power

              [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

              1 Reply Last reply
              0
              • A antonaras

                Thanks for the reply Yes i'm doing a console application SARATH can u pls write again the include files that i need to use the code was cut off Thanks again

                S Offline
                S Offline
                Sarath C
                wrote on last edited by
                #7

                there is a simple method I can suggest. Create a new console. at the Application settings, "Support MFC" copy the code or add teh file u have implemented to this newly created workspace. it will work fine. that is the better way the include files are AfxWin.h and afxext.h SaRath
                "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

                A 1 Reply Last reply
                0
                • S Sarath C

                  there is a simple method I can suggest. Create a new console. at the Application settings, "Support MFC" copy the code or add teh file u have implemented to this newly created workspace. it will work fine. that is the better way the include files are AfxWin.h and afxext.h SaRath
                  "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

                  A Offline
                  A Offline
                  antonaras
                  wrote on last edited by
                  #8

                  Thanks alot i appreciate all the help

                  1 Reply Last reply
                  0
                  • A antonaras

                    Thanks for the reply Yes i'm doing a console application SARATH can u pls write again the include files that i need to use the code was cut off Thanks again

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

                    antonaras wrote:

                    SARATH can u pls write again the include files that i need to use the code was cut off

                    They're there:

                    #include <afxwin.h> // MFC core and standard components
                    #include <afxext.h> // MFC extensions


                    "The largest fire starts but with the smallest spark." - David Crow

                    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