Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to use CString in non-MFC applications?

applications cstring non-mfc
0
Posted

How to use CString in non-MFC applications?

0

(Top) In most cases, you don’t need to do that. In order to use CString you have to statically or dynamically link your application to the entire MFC. This would not only increase the size of your executable file, the number of its dependencies, but also makes your program non-portable (especially if it is a Console application). The recommended solution is to use the Standard C++ Class std::string. It is as powerfull as CString, is portable, using it does not imply adding a huge amount of things you don’t need to your project and last, but not least, it is part of the programming language. This being said, if you still want to use CString in your non-MFC application, here it is whar you have to do: – Include in one of your main headers; – Open the menu “Project”, submenu “Settings”. On the “General” tab of the settings dialog box choose “Use MFC in a Shared DLL” or “Use MFC in a Static Library” from the dropdown called “Microsoft Foundation Classes”. – Rebuild your project.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123