<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-27231672</id><updated>2011-04-21T12:01:41.004-07:00</updated><category term='string conversions'/><category term='Explicit Constructors'/><category term='C2440'/><category term='string families'/><category term='CString'/><category term='std::string'/><category term='correlations'/><category term='history'/><title type='text'>Visual Studio's CString FAQs...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cstrings.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-27231672.post-116396845577298498</id><published>2006-11-19T11:30:00.000-08:00</published><updated>2007-07-28T13:17:24.496-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Explicit Constructors'/><category scheme='http://www.blogger.com/atom/ns#' term='CString'/><category scheme='http://www.blogger.com/atom/ns#' term='C2440'/><title type='text'>What's the deal with CString and explicit constructors (C2440)?</title><summary type='text'>Let me first address the question:Q. What are explicit constructors?A. Constructors that use the explicit keyword. Explicit constructors are used to avoid unintentional conversions. Constructors that don't use the C++ explicit keyword are implicit by default.Q. Why are they used by CString?A. CString is functionally a string class designed to make working with TCHAR strings (TCHAR* a.k.a LPTSTR) </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/116396845577298498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/116396845577298498'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/11/whats-deal-with-cstring-and-explicit.html' title='What&apos;s the deal with CString and explicit constructors (C2440)?'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-27231672.post-115618572026567500</id><published>2006-08-21T11:36:00.000-07:00</published><updated>2007-07-28T13:17:52.044-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='string conversions'/><category scheme='http://www.blogger.com/atom/ns#' term='std::string'/><category scheme='http://www.blogger.com/atom/ns#' term='CString'/><title type='text'>How to convert from std::string to CString?</title><summary type='text'>This is simple... Use the CString constructor.std::string strStdString ("Hello!");// Using CString ConstructorCString strCString (strStdString.c_str ());Let me add that CStringT can construct from both character or wide-character strings. i.e. It can convert from char* (i.e. LPSTR) or from wchar_t* (LPWSTR).In other words, char-specialization (of CStringT) i.e. CStringA, wchar_t-specilization </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/115618572026567500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/115618572026567500'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/08/how-to-convert-from-stdstring-to.html' title='How to convert from std::string to CString?'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-27231672.post-115618338084622424</id><published>2006-08-21T10:29:00.000-07:00</published><updated>2007-07-28T13:18:09.664-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='string conversions'/><category scheme='http://www.blogger.com/atom/ns#' term='std::string'/><category scheme='http://www.blogger.com/atom/ns#' term='CString'/><title type='text'>How to convert from CString to std::string?</title><summary type='text'>There are really many ways to do it.But,  the simplest one is just this -CString strSomeCstring ("This is a CString Object");// Use ANSI variant CStringA to convert to char*; construct from it -std::string strStdString (CStringA (strSomeCstring));Note that as discussed in this post, CStringA is a template specialization of class CStringT for type char avaÃ­lable with Visual Studio 7.x and better.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/115618338084622424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/115618338084622424'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/08/how-to-convert-from-cstring-to.html' title='How to convert from CString to std::string?'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-27231672.post-114626071296015583</id><published>2006-04-28T14:23:00.000-07:00</published><updated>2007-07-28T13:18:30.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='correlations'/><category scheme='http://www.blogger.com/atom/ns#' term='string families'/><title type='text'>Finding correlations between the CString Family and the Standard String Family</title><summary type='text'>If we were to draw a correlation between the CString Family and Standard String Classes, we would notice -CStringT  as the equivalent of std::basic_stringCStringA as the equivalent of std::stringCStringW as the equivalent of std::wstringHowever, the standard library itself doesn't contain a "CString" equivalent - one that can at best be - std::basic_string &lt;TCHAR&gt;This makes CString (VS 7.x +) "</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114626071296015583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114626071296015583'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/04/finding-correlations-between-cstring.html' title='Finding correlations between the CString Family and the Standard String Family'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-27231672.post-114625901652105466</id><published>2006-04-28T13:47:00.000-07:00</published><updated>2007-07-28T13:18:50.190-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CString'/><category scheme='http://www.blogger.com/atom/ns#' term='history'/><title type='text'>The history of CString...</title><summary type='text'>CString really wasn't always as likeable as it is today. If one were to compare the CString of Visual Studio 7.x and better with the class supplied by MSVC 6.0, one might not be wrong in judging the erstwhile version as relatively inflexible, and restrictive.What made CString of yesterday "inflexible"?1.Only for MFC-folks!Yes... CString with MSVC 6.0 was notoriously connected to MFC Projects as </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114625901652105466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114625901652105466'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/04/history-of-cstring.html' title='The history of CString...'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-27231672.post-114625629837625661</id><published>2006-04-28T13:30:00.000-07:00</published><updated>2006-04-28T14:59:01.203-07:00</updated><title type='text'>The rationale behind this FAQ...</title><summary type='text'>In the past few years of answering questions aplenty on Codeguru's Visual C++ Forum, I have realized the following three things -CString counts amongst the most popularly used string classes - ever.People keep asking questions that have been answered many times over, but answers to which are not easily locatable.(1) and (2) are going to continue being this way for some time now.So, me thinks - </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114625629837625661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27231672/posts/default/114625629837625661'/><link rel='alternate' type='text/html' href='http://cstrings.blogspot.com/2006/04/rationale-behind-this-faq.html' title='The rationale behind this FAQ...'/><author><name>Siddhartha Rao</name><uri>http://www.blogger.com/profile/02278521553171894987</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://3.bp.blogspot.com/_ks70DneDuEY/SwlCzt91ISI/AAAAAAAAFUI/DKntliA1wNw/S220/Sid.jpg'/></author></entry></feed>
