<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: USES_CONVERSION &#8211; a cautionary tale</title>
	<atom:link href="http://untidy.net/blog/2004/12/17/uses_conversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://untidy.net/blog/2004/12/17/uses_conversion/</link>
	<description>simon steele writes about stuff...</description>
	<lastBuildDate>Sun, 09 Oct 2011 17:28:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: sasha</title>
		<link>http://untidy.net/blog/2004/12/17/uses_conversion/comment-page-1/#comment-42649</link>
		<dc:creator>sasha</dc:creator>
		<pubDate>Wed, 15 Oct 2008 08:33:27 +0000</pubDate>
		<guid isPermaLink="false">http://untidy.net/blog/2004/12/17/uses_conversion-a-cautionary-tale/#comment-42649</guid>
		<description>Also, there is a sprinf(s, &quot;%S&quot;, unicodeStr);
to convert from Unicode to Ansi</description>
		<content:encoded><![CDATA[<p>Also, there is a sprinf(s, &#8220;%S&#8221;, unicodeStr);<br />
to convert from Unicode to Ansi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siddhartha Rao</title>
		<link>http://untidy.net/blog/2004/12/17/uses_conversion/comment-page-1/#comment-957</link>
		<dc:creator>Siddhartha Rao</dc:creator>
		<pubDate>Sat, 22 Oct 2005 21:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://untidy.net/blog/2004/12/17/uses_conversion-a-cautionary-tale/#comment-957</guid>
		<description>Hi Simon,

Saw your write-up and thought I must add that VC++ 7.x allows one to convert strings using conversion classes (instead of macros), and that an equivalent of A2W would be CA2W, of W2T would be CW2T, so on and so forth.

Yes, these are safe to use in loops, and will not cause Stack Overflow Exceptions. :-)

Also, note that one can always trust the good old WideCharToMultiByte, and MultiByteToWideChar functions, and that CComBSTR can construct a BSTR from Regular Character Strings, and Wide Character Strings both.

Enjoy Converting. :-)

Best Regards,
Siddhartha

PS: Coincidentally, I have a FAQ on this topic as well, a link to which I’ve provided above.

__________
Siddhartha Rao
Microsoft MVP - Visual C++
Codeguru Moderator</description>
		<content:encoded><![CDATA[<p>Hi Simon,</p>
<p>Saw your write-up and thought I must add that VC++ 7.x allows one to convert strings using conversion classes (instead of macros), and that an equivalent of A2W would be CA2W, of W2T would be CW2T, so on and so forth.</p>
<p>Yes, these are safe to use in loops, and will not cause Stack Overflow Exceptions. <img src='http://untidy.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Also, note that one can always trust the good old WideCharToMultiByte, and MultiByteToWideChar functions, and that CComBSTR can construct a BSTR from Regular Character Strings, and Wide Character Strings both.</p>
<p>Enjoy Converting. <img src='http://untidy.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Best Regards,<br />
Siddhartha</p>
<p>PS: Coincidentally, I have a FAQ on this topic as well, a link to which I’ve provided above.</p>
<p>__________<br />
Siddhartha Rao<br />
Microsoft MVP &#8211; Visual C++<br />
Codeguru Moderator</p>
]]></content:encoded>
	</item>
</channel>
</rss>

