|
-
Aug 7th, 2002, 08:57 AM
#1
Thread Starter
New Member
CString bob = stl::string fred problem
I have a silly question.
How do I convert a STL string to a MFC CString in an elegant way?
using namespace std;
CString bob;
string fred;
bob = fred; // Deos not work, duh!
-
Aug 7th, 2002, 09:54 AM
#2
Frenzied Member
I would imagine:
Code:
std::string x = "Hello";
CString y = x.c_str();
Z.
-
Aug 7th, 2002, 02:28 PM
#3
Addicted Member
std in MFC exe
How come I can't get std::string get to work in
my MFC dialog based exe ?
If I use std::string in my class,
I get error :
'std' : is not a class or namespace name
'string' : undeclared identifier
using namespace does not help either .
What's up with me ?
-
Aug 7th, 2002, 02:47 PM
#4
Frenzied Member
Probably didnt include <string>.
Z.
-
Aug 7th, 2002, 02:54 PM
#5
-
Aug 13th, 2002, 05:53 AM
#6
Maybe you included <string> before "stdafx.h". The compiler ignores any code prior to this include if activated.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|