String header file with CString header file

Source: Internet
Author: User

First, the header file of string

1. <string>

C + + header file with Std wrapped

2. <string.h>

The old C header file

3. <cstring.h>

STD version of the old C header file, Remember that this is not the CString header file

See the 49th of effective C + +

Besides, CString's head file.

Note: Under VC9 compilation environment

1. <atlstr.h>

Non-MFC version, the console program uses this

2. <afxstr.h>

MFC version, you need to link to the MFC DLL or static library. Many people on the internet say that to include <afx.h>,<afx.h> contains more than CObject and its derived classes, as well as the file class, time class, Exception class, String class, and so on (more than 700 rows of the location contains Afxstr.h), If you just need CString, it's enough to include <afxstr.h>.

Pre-treatment in <afx.h>

#ifdef _dll

#ifndef _afxdll

#error Building MFC Application With/md[d] (CRT DLL version) requires MFC shared DLL version. Please #define _afxdll or does not use/md[d]

#endif

#endif

Pre-treatment in <afxstr.h>

#ifndef _afx

#error Afxstr.h can only is used in MFC projects. Use Atlstr.h

#endif

Notice the above #error, to the effect that this header file is used in the MFC project. Either switch to <ATLSTR.H>, or use MFC in a shared DLL, in the general, properties----, project--.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.