I am string to use the class CString in my WIN32 program. It don't work :mad: . What must I include?
Printable View
I am string to use the class CString in my WIN32 program. It don't work :mad: . What must I include?
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?
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?
How do you link to the MFC libraries?
If you're using MSVC 6.0++ select Project-Settings. On the general tab select "Using MFC in a Static Library/Shared DLL".
thanks
>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 ;)