<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx</link><description>Yesterday I posted a code snippet from inside a real piece of code inside the client side of a client/server utility in a Microsoft product. static DWORD WINAPI _PlayBeep(__in void* pv) { UNREFERENCED_PARAMETER(pv); PlaySound(L&amp;quot;.Default&amp;quot;, NULL,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9808928</link><pubDate>Mon, 29 Jun 2009 23:51:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808928</guid><dc:creator>Alexandre Grigoriev</dc:creator><description>&lt;p&gt;Under &amp;quot;things you should not do&amp;quot; I'd also add &amp;quot;playing Ding in response to an unknown key in a server UI utility&amp;quot;.&lt;/p&gt;</description></item><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9809547</link><pubDate>Tue, 30 Jun 2009 14:45:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809547</guid><dc:creator>tb</dc:creator><description>&lt;p&gt;Also filed under &amp;quot;reasons to not reinvent the wheel.&amp;quot; There was a perfectly good async call already.&lt;/p&gt;
&lt;p&gt;Start thinking in microseconds, and a second becomes an eternity.&lt;/p&gt;</description></item><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9809638</link><pubDate>Tue, 30 Jun 2009 16:36:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809638</guid><dc:creator>Maurits</dc:creator><description>&lt;p&gt;&amp;quot;Ding&amp;quot; in response to an unknown key is quite common; numeric-only text inputs do it, for example.&lt;/p&gt;
&lt;p&gt;Open Notepad;&lt;/p&gt;
&lt;p&gt;Ctrl-G to pop up the &amp;quot;go to line number&amp;quot; box;&lt;/p&gt;
&lt;p&gt;press a non-numeric key (&amp;quot;A&amp;quot;)&lt;/p&gt;
&lt;p&gt;Ding!&lt;/p&gt;
</description></item><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9809650</link><pubDate>Tue, 30 Jun 2009 16:48:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809650</guid><dc:creator>Alexandre Grigoriev</dc:creator><description>&lt;p&gt;Maurits,&lt;/p&gt;
&lt;p&gt;Notepad is quite old, and was designed for general audience. &lt;/p&gt;
&lt;p&gt;On the other hand, the server utility we're discussing doesn't need those bells and whistles.&lt;/p&gt;</description></item><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9809816</link><pubDate>Tue, 30 Jun 2009 20:11:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809816</guid><dc:creator>jcoehoorn</dc:creator><description>&lt;p&gt;As a followup then, when would you ever want to use SND_SYNC? &amp;nbsp;Or, put another way, what are the potential costs of this fix?&lt;/p&gt;</description></item><item><title>re: What’s wrong with this code, part 26 – the answer</title><link>http://blogs.msdn.com/larryosterman/archive/2009/06/29/what-s-wrong-with-this-code-part-26-the-answer.aspx#9810027</link><pubDate>Wed, 01 Jul 2009 00:00:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810027</guid><dc:creator>Ben Voigt [C++ MVP]</dc:creator><description>&lt;p&gt;I guess as a specific case of &amp;quot;long running items&amp;quot;, don't do any UI work whatsoever from threadpool threads, right? &amp;nbsp;At most you should Post (not Send) a message to a window or thread whose message queue has already been created (you know because the thread created its message queue before starting the work item).&lt;/p&gt;</description></item></channel></rss>