<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>debugview | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/debugview/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Tue, 24 Mar 2020 19:47:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>debugview | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Logging on Windows &#8211; OutputDebugString</title>
		<link>https://learncgames.com/logging-on-windows-outputdebugstring/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=logging-on-windows-outputdebugstring</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 01 Apr 2020 23:00:56 +0000</pubDate>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[debugview]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=280</guid>

					<description><![CDATA[<p>In the post about rsyslog three days ago, I explained how to log from Linux programs using the rsyslog daemon. It&#8217;s slightly different in Windows. There&#8217;s a built in function called OutputDebugString(LPCWSTR str) that you can call from anywhere in your program. It dumps the string str into the Output window if you are debugging it [&#8230;]</p>
The post <a href="https://learncgames.com/logging-on-windows-outputdebugstring/">Logging on Windows – OutputDebugString</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:789,&quot;href&quot;:&quot;https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/debugapi\/nf-debugapi-outputdebugstringw&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20220819064318\/https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/debugapi\/nf-debugapi-outputdebugstringw&quot;,&quot;redirect_href&quot;:&quot;https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/debugapi\/nf-debugapi-outputdebugstringw&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-08 05:17:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 08:40:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-18 15:47:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 23:21:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 10:13:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 15:24:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-13 06:58:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 04:40:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 12:48:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-25 06:20:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 06:45:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-09 10:45:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 03:46:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 12:07:22&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 12:07:22&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:722,&quot;href&quot;:&quot;https:\/\/docs.microsoft.com\/en-gb\/sysinternals\/downloads\/debugview&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20220506060827\/https:\/\/docs.microsoft.com\/en-gb\/sysinternals\/downloads\/debugview&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 17:54:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 08:40:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 09:55:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 12:43:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 23:21:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 10:13:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 13:20:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-13 06:59:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 04:40:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 12:48:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-25 06:20:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 06:45:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-09 10:45:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 03:46:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-19 12:07:19&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-19 12:07:19&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img fetchpriority="high" decoding="async" class="size-medium wp-image-282 alignleft" src="https://learncgames.com/wp-content/uploads/2020/03/outputdebugstring-300x204.png" alt="Shows OutputDebugString being calld in the debugger" width="300" height="204" srcset="https://learncgames.com/wp-content/uploads/2020/03/outputdebugstring-300x204.png 300w, https://learncgames.com/wp-content/uploads/2020/03/outputdebugstring.png 430w" sizes="(max-width: 300px) 100vw, 300px" />In the post about rsyslog three days ago, I explained how to log from Linux programs using the rsyslog daemon.</p>
<p>It&#8217;s slightly different in Windows. There&#8217;s a built in function called <a href="https://docs.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringw" target="_blank" rel="noopener noreferrer">OutputDebugString(LPCWSTR str)</a> that you can call from anywhere in your program. It dumps the string str into the Output window if you are debugging it in Visual Studio.</p>
<p>If you are running this outside of a debugger, the output is lost unless you can capture it with a suitable utility. <a href="https://docs.microsoft.com/en-gb/sysinternals/downloads/debugview" target="_blank" rel="noopener noreferrer">DebugView</a> from SysInternals.com (it redirects to Microsoft) is one such utility. That&#8217;s a screenshot of it below.</p>
<p><img decoding="async" class="size-medium wp-image-283 alignleft" src="https://learncgames.com/wp-content/uploads/2020/03/debugview-300x144.png" alt="Showing DebugView in action" width="300" height="144" srcset="https://learncgames.com/wp-content/uploads/2020/03/debugview-300x144.png 300w, https://learncgames.com/wp-content/uploads/2020/03/debugview.png 441w" sizes="(max-width: 300px) 100vw, 300px" />Just run DebugView and leave it there. It might catch other stuff from Windows, but when you run your program from the command line or double click on it, it will execute quickly and you&#8217;ll see any strings captured like this one.</p>
<p>&nbsp;</p>
<p>This is the program that I ran. In Release it compiles to a 9 KB exe! Because OutPutDebugString needs a <a href="https://docs.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringw" target="_blank" rel="noopener noreferrer">LPCWSTR </a> (Long Pointer to a WideString), I declared the text as wchar_t.</p>
<pre><code class="language-c" data-line="">#include &lt;Windows.h&gt;

int main()
{
    wchar_t * text=L&quot;Hello World!\n&quot;;
    OutputDebugString(text);
}
</code></pre>
<p>At work I developed a very large program that only worked running on another computer. I used OutputDebugString extensively and without it, debugging would have been much harder.</p>The post <a href="https://learncgames.com/logging-on-windows-outputdebugstring/">Logging on Windows – OutputDebugString</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">280</post-id>	</item>
	</channel>
</rss>
