CString????-newbie
-
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 -
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 lotCString 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! ]
-
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 lotU 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!" -
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 -
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!" -
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
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! ]
-
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
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!" -
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!" -
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
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