<?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>NaRiver &#187; Windows</title>
	<atom:link href="http://nariver.com/archives/category/windows/feed" rel="self" type="application/rss+xml" />
	<link>http://nariver.com</link>
	<description>漫无目的的流淌，也有歌唱，伴着忧伤</description>
	<lastBuildDate>Thu, 30 Jun 2011 14:10:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WPF Linked resources导致”cannot locate resource”错误</title>
		<link>http://nariver.com/archives/622</link>
		<comments>http://nariver.com/archives/622#comments</comments>
		<pubDate>Fri, 18 Mar 2011 09:05:17 +0000</pubDate>
		<dc:creator>NaRiver</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://nariver.com/?p=622</guid>
		<description><![CDATA[<a href="http://nariver.com/archives/622" title="WPF Linked resources导致&quot;cannot locate resource&quot;错误"></a>【注意】这个问题在Visual Stuido2010（.Net Framework4.0）中已经修复，在VS2010中Source应该改为全路径，否则会导致运行时资源无法定位。 错误描述： 当我们向WPF项目中添加文件(Add items)时，我们可以选择”Add As Link”，这样做的目的是：我们可以在多个项目之间共享同一个文件（比如一个被多个项目引用的图标文件，或者项目间共享的资源等）。 但是，如果引用的对象位于项目的某个目录中，我们将无法用通常的URI语法来加载资源，比如下图中我们将以链接形式添加Info.xml文件到项目中(比如我们将它添加到目录Data下)： 当我们希望在XAML文档中引用该资源时： Source="pack://application:,,,/AssemblyName;component/Data/Info.xml" 以上代码在运行时会报错（cannot locate resource ‘Data/Info.xml’） 如果不是Add As Link方式而是直接添加以上资源的话，上面的代码是没有问题的，可是由于微软对Link文件的路径处理和普通项目文件有一定的区别，所以导致运行时无法正确加载资源文件。 解决方法： Link的资源在VS2008下，默认编译完成后，是放在根目录下的，而不是我们设置的Data目录下： 修改为以下路径后可以解决问题： Source="pack://application:,,,/AssemblyName;component/Info.xml" 引用资源： 关于该Bug的详细描述和微软官方回复： http://connect.microsoft.com/VisualStudio/feedback/details/512027/linked-files-in-folders-are-not-output-correctly-in-wpf 其他参考的问题解决方法： http://stackoverflow.com/questions/428609/how-can-i-address-hopefully-in-xaml-a-linked-resource-properly-in-wpf http://devblog.ailon.org/devblog/post/2010/01/13/Writing-WPFSilverlight-compatible-code-Part-6-Adding-XAML-files-as-links.aspx]]></description>
		<wfw:commentRss>http://nariver.com/archives/622/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set WPF window position according to DPI settings</title>
		<link>http://nariver.com/archives/605</link>
		<comments>http://nariver.com/archives/605#comments</comments>
		<pubDate>Fri, 10 Dec 2010 10:23:27 +0000</pubDate>
		<dc:creator>NaRiver</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Windows Programing]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://nariver.com/?p=605</guid>
		<description><![CDATA[<a href="http://nariver.com/archives/605" title="How to set WPF window position according to DPI settings"></a>Vista中当DPI设置改变的时候，屏幕的尺寸会改变，如果WPF窗口的位置是具体像素值偏移的，就需要根据当前的DPI配置进行相应的调整。 可以得到的系统参数(System Parameters we can get from WPF): System.Windows.Forms.SystemInformation.WorkingArea (Width, Height) Use WorkingArea to determine the bounds of the screen that can be used by applications. The working area is the portion of the screen not hidden by the operating &#8230;<p class="read-more"><a href="http://nariver.com/archives/605">继续阅读 &#187;</a></p>]]></description>
		<wfw:commentRss>http://nariver.com/archives/605/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPF textblock Run之间的自动填充的空格</title>
		<link>http://nariver.com/archives/579</link>
		<comments>http://nariver.com/archives/579#comments</comments>
		<pubDate>Mon, 22 Nov 2010 10:36:08 +0000</pubDate>
		<dc:creator>NaRiver</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Programing]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://nariver.com/archives/579</guid>
		<description><![CDATA[<a href="http://nariver.com/archives/579" title="WPF textblock Run之间的自动填充的空格"></a>代码： &#60;TextBlock&#62; &#60;Run Foreground=”你确定要删除” Text=”Text”/&#62; &#60;Run Foreground=”配置名称” Text=”Block”/&#62; &#60;Run Text=”？” /&#62; &#60;/TextBlock&#62; 编译后，“？”前面会自动加上一个空格。这个空格是由于XAML（其实也就是XML）解析的时候的特殊空白字符处理规则（special whitespace handling rules）造成的。 去掉这个空格的最简单方法是：把上面的三个Run紧挨着写在同一行上： &#60;TextBlock&#62; &#60;Run Foreground=”你确定要删除” Text=”Text”/&#62;&#60;Run Foreground=”配置名称” Text=”Block”/&#62;&#60;Run Text=”？” /&#62; &#60;/TextBlock&#62;]]></description>
		<wfw:commentRss>http://nariver.com/archives/579/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VS2008:error C2259 cannot instantiate abstract class</title>
		<link>http://nariver.com/archives/486</link>
		<comments>http://nariver.com/archives/486#comments</comments>
		<pubDate>Wed, 24 Feb 2010 01:51:49 +0000</pubDate>
		<dc:creator>NaRiver</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[Visual studio]]></category>

		<guid isPermaLink="false">http://nariver.com/?p=486</guid>
		<description><![CDATA[<a href="http://nariver.com/archives/486" title="VS2008:error C2259 cannot instantiate abstract class"></a>Visual Studio2008编译错误error C2259 cannot instantiate abstract class 经过检查，发现源代码中确实已经派生了虚函数，派生的虚函数源文件也正常编译。 最后在微软的官方网站上找到了答案（可能只是error C2259其中一种可能的原因，供参考）： This behavior is by design with VS 2005. The root cause is because wchar_t is a different type than unsigned short though in prior versions of Visual C++, the compiler &#8230;<p class="read-more"><a href="http://nariver.com/archives/486">继续阅读 &#187;</a></p>]]></description>
		<wfw:commentRss>http://nariver.com/archives/486/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio LNK2005 error</title>
		<link>http://nariver.com/archives/453</link>
		<comments>http://nariver.com/archives/453#comments</comments>
		<pubDate>Wed, 20 Jan 2010 06:02:29 +0000</pubDate>
		<dc:creator>NaRiver</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Visual studio]]></category>

		<guid isPermaLink="false">http://nariver.com/?p=453</guid>
		<description><![CDATA[<a href="http://nariver.com/archives/453" title="Visual Studio LNK2005 error"></a>环境：  Visual Studio 2008 C++ 编译错误： error LNK2005: _DllMain@12 already defined &#8230; The CRT libraries use weak external linkage for the new, delete, and DllMain functions. The MFC libraries also contain new, delete, and DllMain functions. These functions require the &#8230;<p class="read-more"><a href="http://nariver.com/archives/453">继续阅读 &#187;</a></p>]]></description>
		<wfw:commentRss>http://nariver.com/archives/453/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

