I am string to use the class CString in my WIN32 program. It don't work . What must I include?
I am string to use the class CString in my WIN32 program. It don't work . What must I include?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
You need to include afx.h and link to the MFC libraries.
Is there a way to build (format) a string using just windows.h?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
I tried what you said, but I got an error about not being able to find a lib file. It isn't on my computer. The reason this is odd is I have another program that is 100% MFC that uses CString just great. What's the connection?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
How do you link to the MFC libraries?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
If you're using MSVC 6.0++ select Project-Settings. On the general tab select "Using MFC in a Static Library/Shared DLL".
thanks
"If you tell the truth, you don't have to remember anything"
-Mark Twain
>Is there a way to build (format) a string using just windows.h?
You can do it in plain ANSI C by using the sprintf function that does the same thing as CString::Format for character arrays. But if you got it working, use CString, it's simpler for adding and replacing
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.