<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://yin-gang.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fyin-gang.spaces.live.com%2fcategory%2f%e5%bc%80%e5%8f%91%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>江南西道: 开发</title><description /><link>http://yin-gang.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=cat%25E5%25BC%2580%25E5%258F%2591</link><language>en-US</language><pubDate>Sat, 23 Aug 2008 04:31:46 GMT</pubDate><lastBuildDate>Sat, 23 Aug 2008 04:31:46 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://yin-gang.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>8460845320381072468</live:id><live:alias>yin-gang</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>被防火墙阴了...</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!853.entry</link><description>&lt;p&gt;昨天下午调试程序，程序启动时会监听端口A和端口B的UDP消息，也会定期从端口A往其它机器发送UDP消息，而其它机器回复的UDP消息有可能发往端口A或端口B。我碰到的问题是，如果从端口A发，那回复的UDP消息中只有发往端口A的能收到，如果从端口B发，就只能收到发往端口B的UDP消息。 &lt;p&gt;然后今天才发现收不到的UDP消息原来是被系统自带的防火墙给挡了，囧。。。监听UDP端口时，系统防火墙不会有询问是否加入防火墙规则，也就是默认阻挡，但一旦有UDP消息从某个端口发出去，则从那个端口进来的UDP消息也是可以通过的。这个好像叫UDP Tunnel之类的吧，之前应该看到过一些相关的介绍。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e8%a2%ab%e9%98%b2%e7%81%ab%e5%a2%99%e9%98%b4%e4%ba%86...&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!853.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!853.entry</guid><pubDate>Thu, 21 Aug 2008 04:19:43 GMT</pubDate><slash:comments>2</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!853/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!853.entry#comment</wfw:comment><dcterms:modified>2008-08-21T04:19:43Z</dcterms:modified></item><item><title>gVim 不错</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!781.entry</link><description>&lt;p&gt;配上 taglist、grep、winmanager、minibufexpl 等扩展，加上 win 版的 ctags、grep 等执行程序，目前来说，至少看看代码的效果还是不错的：） &lt;p&gt;推荐参考文章：《&lt;a href="http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx"&gt;手把手教你把Vim改装成一个IDE编程环境&lt;/a&gt;》！ &lt;p&gt;另外，我现在是用这个来看 VB6 的代码，而 ctags 不太认识 VB6 的代码，需要 &lt;a href="http://www.rutherfurd.net/weblog/2003/04/index.html"&gt;写一个 ctags.cnf文件&lt;/a&gt; 放到 ctags.exe 所在目录： &lt;p&gt;--langdef=vb&lt;br&gt;--langmap=vb:.bas.cls.ctl.frm.vbs&lt;br&gt;--regex-vb=/^(Public|Private|\b)[ \t]*Sub[ \t]+([a-zA-Z0-9_]+)/\2/s,subroutine/i&lt;br&gt;--regex-vb=/^(Public|Private|\b)[ \t]*Function[ \t]+([a-zA-Z0-9_]+)/\2/f,function/i&lt;br&gt;--regex-vb=/^(Public|Private)[ \t]+([a-zA-Z0-9_]+)[ \t]+As[ \t]+/\2/v,variable/i&lt;br&gt;--regex-vb=/^(Public|Private|\b)[ \t]*Const[ \t]+([a-zA-Z0-9_]+)[ \t]+(As|=)[ \t]+/\2/c,const/i&lt;br&gt;--regex-vb=/^(Public|\b)[ \t]*Property[ \t]*(Get|Let|Set)[ \t]+([a-zA-Z0-9_]+)/\3/n,name/i&lt;br&gt;--regex-vb=/^(Public|Private|\b)[ \t]*Enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enum/i&lt;br&gt;--regex-vb=/^([a-zA-Z_]+):/\1/l,label/i &lt;p&gt;这样之后 ctags -R 的时候就会正常工作了。 &lt;p&gt;然后在 _vimrc 中 &lt;a href="http://vim-taglist.sourceforge.net/extend.html"&gt;加上一行针对 VB 的 taglist 设置&lt;/a&gt;，例如： &lt;p&gt;let tlist_vb_settings = 'vb;s:sub;f:function;c:const;v:variables' &lt;p&gt;碰到过有个 .frm 文件老是不能自动识别出文件类型，然后查到 filetype.vim 中有段脚本是根据文件的前五行有没有几个 VB 代码特有的关键字来判断是不是 VB 的文件，但我这个文件前面有好几行是引用的 ocx 控件信息，而 filetype.vim 要找的信息在第七行，呼呼呼，直接给加上了几个 getline 搞定。。。 &lt;p&gt;看来我的《&lt;a href="http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!766.entry"&gt;寻找记事本&lt;/a&gt;》又有个强力的候选者了，本来以为 gVim 只是简单地将 vim 移植到 windows 平台而已，但试用下来发现还是有不少适应 windows 平台的改进，不错，不错。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+gVim+%e4%b8%8d%e9%94%99&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!781.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!781.entry</guid><pubDate>Sat, 10 May 2008 12:57:59 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!781/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!781.entry#comment</wfw:comment><dcterms:modified>2008-05-13T07:23:18Z</dcterms:modified></item><item><title>log4cxx 0.10.0 出啦</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!757.entry</link><description>&lt;p&gt;邮件列表中看到折腾了七八个 RC，终于发布了近四年来的第一个 &lt;a href="http://logging.apache.org/log4cxx/download.html"&gt;release&lt;/a&gt;。。。 &lt;p&gt;编译过程需要使用稍早时候出的 &lt;a href="http://ant-contrib.sourceforge.net/"&gt;cpptasks&lt;/a&gt; 的 1.0b5 版本，不过下载过来的压缩包没有包括编译好的 jar 包，需要自己用 Ant 来 build 一下。 &lt;p&gt;apr 和 apr-util 不像以前那样是自动下载并解压，需要自己下载并解压至 &lt;a href="http://logging.apache.org/log4cxx/download.html"&gt;apache-log4cxx-0.10.0&lt;/a&gt; 的同级目录（或者在 build 时加参数指定位置也行），我分别用的是 1.2.11 和 1.2.10 版本。 &lt;p&gt;build 前先运行一下根目录下的 configure.bat（采用 win 版头文件）和 configure-aprutil.bat（禁用 APR-Iconv 和 LDAP），内容很简单，手工操作也可以。 &lt;p&gt;直接使用 vc9 的 command prompt，将 ant-contrib 和 cpptasks 加入 CLASSPATH（或者直接扔到 Ant 的 lib 目录下也行），然后就可以请出 Ant 了，build 选项和之前稍有些不一样，详细可以看 usage，我这边用的主要是 -Dlib.type=shared 变成了 -Denable-shared=yes（缺省就是共享库），-Dhas.wchar_t=0 变成了 -Denable-wchar_t=0。 &lt;p&gt;用 vc9 还算顺利，用 vc8express 编译出了点问题，提示找不到 windows.h，应该在哪设置一下或者改一下配置文件就行，但这套 java 的东东也不怎么熟悉，先不管了。。。 &lt;p&gt;其它配套软件版本：JDK 1.5.0.14  Ant 1.6.5  Ant-Contrib 1.0b2。 &lt;p&gt;分别编译了 debug 和 release 的 dll，产生的中间文件居然有四百多兆，似乎比大半年前的版本大了几倍，多了些啥呢。。。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+log4cxx+0.10.0+%e5%87%ba%e5%95%a6&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!757.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!757.entry</guid><pubDate>Sat, 05 Apr 2008 03:27:33 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!757/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!757.entry#comment</wfw:comment><dcterms:modified>2008-04-05T03:27:33Z</dcterms:modified></item><item><title>windows 上安装 trac</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!679.entry</link><description>&lt;p&gt;网上介绍 &lt;a href="http://trac.edgewall.org/"&gt;trac&lt;/a&gt; 安装的帖子还不少，先照猫画虎安装上 &lt;a href="http://www.python.org/"&gt;python&lt;/a&gt; 及相关的一些小软件（详细列表见后）。 &lt;p&gt;命令行窗口中切换到 python 的 script 目录，运行 ..\python.exe trac-admin d:\projects\test initenv，输入相关参数（项目名称随意、数据库连接信息缺省、版本工具缺省、版本库位置照实、样式缺省），提示 Failed to create environment。 &lt;p&gt;traceback 的最后是：&lt;br&gt;cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000))) &lt;br&gt;ValueError: database parameter must be string or APSW Connection object &lt;p&gt;貌似是 sqlite 这块有点问题，折腾了好一会，最后才发现是 pysqlite 的版本太新，从 2.4.0 降到 2.3.5 就ok了！ &lt;p&gt;现在安装的相关软件有： &lt;p&gt;python-2.4.4.msi&lt;br&gt;trac-0.10.4.win32.exe&lt;br&gt;clearsilver-0.9.14.win32-py2.4.exe&lt;br&gt;svn-python-1.4.4.win32-py2.4.exe&lt;br&gt;mod_python-3.3.1.win32-py2.4-Apache2.0.exe&lt;br&gt;pysqlite-2.3.5.win32-py2.4.exe &lt;p&gt;机器上本来安装的 subversion 和 tortoisesvn 都是 1.4.4 的，apache 是 2.0.59。 &lt;p&gt;mod_python 安装时需要选择一下 apache2 的安装目录，会自动将 mod_python.so 复制到 modules 目录下，然后在 httpd.conf 中加上： &lt;p&gt;LoadModule python_module modules/mod_python.so &lt;p&gt;&amp;lt;Location /trac&amp;gt;&lt;br&gt;    SetHandler mod_python&lt;br&gt;    PythonHandler trac.web.modpython_frontend &lt;br&gt;    PythonOption TracEnvParentDir D:/projects&lt;br&gt;    PythonOption TracUriRoot /trac&lt;br&gt;&amp;lt;/Location&amp;gt; &lt;p&gt;然后 &lt;a href="http://127.0.0.1:1080/trac/foo"&gt;http://127.0.0.1:1080/trac/foo&lt;/a&gt; 就能访问相应的项目页面了，简单的用户验证可以使用： &lt;p&gt;&amp;lt;LocationMatch &amp;quot;/trac/[^/]+/login&amp;quot;&amp;gt;&lt;br&gt;    AuthType Basic&lt;br&gt;    AuthName &amp;quot;Trac&amp;quot;&lt;br&gt;    AuthUserFile conf/.htpasswd&lt;br&gt;    Require valid-user&lt;br&gt;&amp;lt;/LocationMatch&amp;gt; &lt;p&gt;进一步的配置和使用有空再来了解。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+windows+%e4%b8%8a%e5%ae%89%e8%a3%85+trac&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!679.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!679.entry</guid><pubDate>Sat, 22 Dec 2007 05:57:52 GMT</pubDate><slash:comments>3</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!679/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!679.entry#comment</wfw:comment><dcterms:modified>2007-12-22T13:13:15Z</dcterms:modified></item><item><title>CIA XPSuite 控件的打包</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!636.entry</link><description>&lt;p&gt;转载自&lt;a href="http://www.barrysumpter.com/Misc/Distribution.htm"&gt;&lt;strong&gt;这里&lt;/strong&gt;&lt;/a&gt;，试验了一下，貌似是可以的，有待进一步的检验。 // 之前都没有打包过那几个support dlls。 &lt;p&gt;When creating a setup to install your application, such as &lt;strong&gt;InstallShield&lt;/strong&gt;, make sure you configure the OCX and Support DLL files as &lt;strong&gt;self-registering&lt;/strong&gt; so that during installation of your application, these files will be registered.  Simply copying the files to a computer will not work.   &lt;p&gt;......  &lt;p&gt;The following files are required when distributing an application which uses XPSuite 2.0  &lt;p&gt;The Support DLLs:  &lt;p&gt;ciaXPRegSvr20.DLL - Support file&lt;br&gt;ciaResSvr20.DLL - Support file&lt;br&gt;ciaSubClsSvr.DLL - Support file (All versions use the same DLL)  &lt;p&gt;The Controls:  &lt;p&gt;ciaXPButton20.OCX - XPSuite XP Style Command Button Control Version 2.0&lt;br&gt;ciaXPBalloons20.OCX - XPSuite XP Style Balloon Controls Version 2.0&lt;br&gt;...... &lt;p&gt;后记：还是不喜欢ActiveX的控件...&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+CIA+XPSuite+%e6%8e%a7%e4%bb%b6%e7%9a%84%e6%89%93%e5%8c%85&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!636.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!636.entry</guid><pubDate>Mon, 17 Sep 2007 16:12:56 GMT</pubDate><slash:comments>2</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!636/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!636.entry#comment</wfw:comment><dcterms:modified>2007-09-18T15:28:27Z</dcterms:modified></item><item><title>如何修改SVN中已提交的日志</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!561.entry</link><description>&lt;p&gt;直接在TortoiseSVN中修改过往日志，会提示： &lt;p&gt;DAV request failed;it's possible that the repository's pre-revprop-change hook either failed or is non-existent&lt;br&gt;At least one property change failed; repository is unchanged. &lt;p&gt;因为SVN库中的日志本身是没有进行版本管理的，为防止误操作导致原日志信息丢失，所以缺省禁止对其进行修改。如果要能在客户端进行修改，必须在repository的hook目录下新建一个pre-revprop-change.bat，内容如下： &lt;p&gt;if &amp;quot;%4&amp;quot; == &amp;quot;svn:log&amp;quot; exit 0&lt;br&gt;echo Property '%4' cannot be changed &amp;gt;&amp;amp;2&lt;br&gt;exit 1 &lt;p&gt;在属性修改前，该脚本会被执行，如返回0即表示同意修改。另外，注意该目录下本就有一个pre-revprop-change.tmpl，但那个是xNix的shell脚本，windows平台貌似不太好用。 &lt;p&gt;然后在客户端就可以正常修改了，其后台应该是调用类似下面的命令： &lt;p&gt;svn propset -r N --revprop svn:log &amp;quot;new log message&amp;quot; URL &lt;p&gt;也可以在服务端通过运行下面的命令来做同样的事情，其中FILE是保存新日志信息的文件路径： &lt;p&gt;svnadmin setlog REPOS_PATH -r N FILE &lt;p&gt;如果不新建上面那个hook，就只能在服务端用svnadmin来修改，在上面的命令后加上--bypass-hooks就行。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9SVN%e4%b8%ad%e5%b7%b2%e6%8f%90%e4%ba%a4%e7%9a%84%e6%97%a5%e5%bf%97&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!561.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!561.entry</guid><pubDate>Tue, 17 Jul 2007 13:25:48 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!561/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!561.entry#comment</wfw:comment><dcterms:modified>2007-07-17T13:25:48Z</dcterms:modified></item><item><title>载入java vm时windows出现错误3</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!550.entry</link><description>&lt;p&gt;InstallAnywhere制作的网站安装包，卸载的时候提示完标题中的错误信息就退出了，茫然。 
&lt;p&gt;考虑到之前更新过机器上的jdk版本，在卸载执行文件所在文件夹中找到一个Uninstall xgweb.lax文件，其中就有如下的条目： 
&lt;p&gt;lax.nl.current.vm=C:\\Program Files\\Java\\jre1.5.0_06\\bin\\java.exe 
&lt;p&gt;正是我已经卸载的jre版本，直接修改成现在用的jre1.5.0_10，再次卸载就成功了：） 
&lt;p&gt;&lt;strong&gt;update：&lt;/strong&gt; 
&lt;p&gt;还是这个安装包，有时在安装的时候也会报同样的错误。 
&lt;p&gt;同样的，安装程包会在运行后自解压至系统临时目录下（比如I1183597230），其中的Windows目录下包括一个.lax配置文件，并包含如下的条目： 
&lt;p&gt;lax.nl.valid.vm.list=J2 J1 MSJ 
&lt;p&gt;推测1.5应该不算在这个列表里吧，那应该装一个1.4的JRE就行了，有时间再试。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e8%bd%bd%e5%85%a5java+vm%e6%97%b6windows%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%af3&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!550.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!550.entry</guid><pubDate>Thu, 21 Jun 2007 11:49:08 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!550/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!550.entry#comment</wfw:comment><dcterms:modified>2007-07-11T03:02:57Z</dcterms:modified></item><item><title>Log4cxx中的RollingFileAppender</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!467.entry</link><description>&lt;p&gt;如果是比较老的0.9.7版本，使用如下的配置文件就OK：&lt;br&gt;log4j.rootLogger=debug, R&lt;br&gt;log4j.appender.R=org.apache.log4j.RollingFileAppender&lt;br&gt;log4j.appender.R.File=test.log&lt;br&gt;log4j.appender.R.MaxFileSize=10KB&lt;br&gt;log4j.appender.R.MaxBackupIndex=5&lt;br&gt;log4j.appender.R.layout=org.apache.log4j.PatternLayout&lt;br&gt;log4j.appender.R.layout.ConversionPattern=%d{%y.%m.%d %H:%M:%S} %p %c - %m%n &lt;p&gt;如果是直接从版本库中取出的head revision，上面的配置文件就不起作用了，超过指定大小也不会roll，但使用xml格式的配置文件是没问题的，如：&lt;br&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; ?&amp;gt; &lt;br&gt;&amp;lt;log4j:configuration xmlns:log4j='&lt;a href="http://logging.apache.org/'"&gt;http://logging.apache.org/'&lt;/a&gt; debug=&amp;quot;true&amp;quot;&amp;gt; &lt;br&gt;  &amp;lt;appender name=&amp;quot;ROLLING&amp;quot; class=&amp;quot;org.apache.log4j.rolling.RollingFileAppender&amp;quot;&amp;gt;&lt;br&gt;    &amp;lt;rollingPolicy class=&amp;quot;org.apache.log4j.rolling.FixedWindowRollingPolicy&amp;quot;&amp;gt;&lt;br&gt;      &amp;lt;param name=&amp;quot;fileNamePattern&amp;quot; value=&amp;quot;test.log.%i&amp;quot;/&amp;gt;&lt;br&gt;      &amp;lt;param name=&amp;quot;minIndex&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br&gt;      &amp;lt;param name=&amp;quot;maxIndex&amp;quot; value=&amp;quot;2&amp;quot;/&amp;gt;&lt;br&gt;    &amp;lt;/rollingPolicy&amp;gt;&lt;br&gt;    &amp;lt;triggeringPolicy class=&amp;quot;org.apache.log4j.rolling.SizeBasedTriggeringPolicy&amp;quot;&amp;gt;&lt;br&gt;      &amp;lt;param name=&amp;quot;MaxFileSize&amp;quot; value=&amp;quot;10000&amp;quot; /&amp;gt;&lt;br&gt;    &amp;lt;/triggeringPolicy&amp;gt;&lt;br&gt;    &amp;lt;layout class=&amp;quot;org.apache.log4j.PatternLayout&amp;quot;&amp;gt;&lt;br&gt;      &amp;lt;param name=&amp;quot;ConversionPattern&amp;quot; value=&amp;quot;%d{%y.%m.%d %H:%M:%S} %p %c - %m%n&amp;quot;/&amp;gt;&lt;br&gt;    &amp;lt;/layout&amp;gt;&lt;br&gt;    &amp;lt;param name=&amp;quot;file&amp;quot; value=&amp;quot;test.log&amp;quot;/&amp;gt;&lt;br&gt;    &amp;lt;param name=&amp;quot;append&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br&gt;  &amp;lt;/appender&amp;gt; &lt;br&gt;  &amp;lt;root&amp;gt;&lt;br&gt;    &amp;lt;level value=&amp;quot;info&amp;quot;/&amp;gt;&lt;br&gt;    &amp;lt;appender-ref ref=&amp;quot;ROLLING&amp;quot;/&amp;gt;&lt;br&gt;  &amp;lt;/root&amp;gt;&lt;br&gt;&amp;lt;/log4j:configuration&amp;gt; &lt;p&gt;试着仿照上面的内容写了一个properties文件，仍然没有roll的效果，原因不详。 &lt;p&gt;后续报导：&lt;br&gt;官方网站有个相关的Patch：&lt;a href="http://issues.apache.org/jira/browse/LOGCXX-102"&gt;LOGCXX-102&lt;/a&gt;。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+Log4cxx%e4%b8%ad%e7%9a%84RollingFileAppender&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!467.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!467.entry</guid><pubDate>Tue, 23 Jan 2007 04:15:04 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!467/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!467.entry#comment</wfw:comment><dcterms:modified>2007-01-25T02:28:20Z</dcterms:modified></item><item><title>[整理] 用VC++通过Automation操作Excel表</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!464.entry</link><description>&lt;div&gt;0. 本文针对VC++ 6.0和Excel 2003的组合，其它版本应该类似。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;1. &lt;a href="http://support.microsoft.com/kb/196776/EN-US/"&gt;Office Automation Using Visual C++&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;微软KB中的一篇总括性的文章，对VC++中使用Automation的几种方法及一些相关问题进行了说明，其中也链接了一些实际操作的代码，如数据的批量导入导出等，都是针对使用MFC的方法，而下面这篇对于了解一些背后的原理会有所帮助：&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;a href="http://support.microsoft.com/kb/216686/EN-US/"&gt;How To Automate Excel From C++ Without Using MFC or #import&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;2. 相关的VBA文档，比如对象、方法及常量等的定义，可以查看Office安装目录下的“OFFICE11\2052\VBAXL10.CHM”，如果找不到，运行Office的安装程序，选择应用程序的高级自定义，将Office共享功能中的Visual Basic for Applications及其帮助都选上就有了。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;3. 生成Excel表时，如果要设置单元格的样式为文本，可以调用Range对象的SetNumberFormatLocal方法，参数是COleVariant(&amp;quot;@&amp;quot;)，这个地方折腾了我不少时间，起先总以为是设置Style什么的，好一会也没弄明白，后来是利用Excel的宏功能，将设置单元格样式的操作记录成VBA程序，才得到如上的方法，其它类似问题应该也可以类似处理。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;4. 关于Excel表中有数据的单元格范围，可以对一个已打开的Range对象调用GetCurrentRegion方法来得到。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;5. 用完后（包括碰到异常）别忘记调用_Application的Quit方法，不然进程列表中要有一堆EXCEL.EXE了：）&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;x. 天真是冷啊，打字困难ing...考虑开空调了。&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%5b%e6%95%b4%e7%90%86%5d+%e7%94%a8VC%2b%2b%e9%80%9a%e8%bf%87Automation%e6%93%8d%e4%bd%9cExcel%e8%a1%a8&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!464.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!464.entry</guid><pubDate>Wed, 29 Nov 2006 09:02:52 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!464/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!464.entry#comment</wfw:comment><dcterms:modified>2006-11-29T09:02:52Z</dcterms:modified></item><item><title>卸载不了Feb 2003版本的PSDK (已解决)</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!453.entry</link><description>&lt;div&gt;这个版本的PSDK是以网页形式进行安装和卸载的，今天为了装IE7，将家里机器的Windows 2003升级到了SP1，然后打算将PSDK也对应升级一下，才发现这个问题，一打开卸载页面就会提示说“Object doesn't support this property or method”，而页面上的卸载按钮也是无效的，还没查到解决方法，郁闷了：（&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;后续报导：&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;发现安装新版本PSDK时会自动卸载旧的版本，俺真是土人多虑了...&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e5%8d%b8%e8%bd%bd%e4%b8%8d%e4%ba%86Feb+2003%e7%89%88%e6%9c%ac%e7%9a%84PSDK+(%e5%b7%b2%e8%a7%a3%e5%86%b3)&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!453.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!453.entry</guid><pubDate>Sat, 28 Oct 2006 14:22:09 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!453/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!453.entry#comment</wfw:comment><dcterms:modified>2006-10-28T14:40:03Z</dcterms:modified></item><item><title>编译安装 log4cxx 的 SVN 版本</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!449.entry</link><description>&lt;div&gt;下面的文章由 anileci@newsmth 编写，我适当修改了小部分内容。编译过程还算顺利，但在自己的测试程序中使用还有些问题，动态链接基本正常，静态链接则会碰到一些奇怪的链接错误（VC6 还没搞定，VC7 正常），还有就是原来在 0.9.7 中好用的 RollingFileAppender，现在不会自动 roll 了，不清楚是不是配置文件的定义和以前不太一样了。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size=2&gt;编译安装log4cxx0.10.0[SVN REV:465428]的方法&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;     修改自&lt;/em&gt;&lt;em&gt; Rainny@newsmth&lt;/em&gt;&lt;em&gt; (瑞霓山主·水木遗少) 给我的说明。&lt;/em&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;系统预装了jdk 1.5.0_08，VS 2005，&lt;a href="http://tortoisesvn.net/downloads"&gt;TortoiseSVN&lt;/a&gt; 1.4.0。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;1. 取得log4cxx的源代码&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;a) 在windows explorer窗口点右键，选择&amp;quot;SVN Checkout…&amp;quot;，弹出对话框，&amp;quot;URL of repository&amp;quot; 填 &amp;quot;&lt;a href="http://svn.apache.org/repos/asf/logging/log4cxx/trunk"&gt;http://svn.apache.org/repos/asf/logging/log4cxx/trunk&lt;/a&gt;&amp;quot;，&amp;quot;Checkout directory&amp;quot; 填 &amp;quot;d:\Build\log4cxx&amp;quot;，点OK即可。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;2. 编译&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;a) 取得Ant: 至&lt;a href="http://ant-contrib.sourceforge.net/"&gt;http://ant-contrib.sourceforge.net&lt;/a&gt;，下载最新版的cpptasks和ant-contrib，分别解压到d:\cpptasks和d:\ant-contrib&lt;br&gt;b) 打开Command Prompt&lt;br&gt;c) set CLASSPATH= %CLASSPATH%;d:\cpptasks\cpptasks.jar;d:\ant-contrib\lib\ant-contrib.jar&lt;br&gt;d) call &amp;quot;%VS80COMNTOOLS%\vsvars32.bat&amp;quot; ，如果是VS2003则改为 call &amp;quot;%VS71COMNTOOLS%\vsvars32.bat&amp;quot;，如果是VS6则到VC98\Bin下面找&lt;br&gt;e) cd d:\Build\log4cxx&lt;br&gt;f) 生成log4cxx库的命令：（要查看更多的build选项请运行d:\apache-ant\bin\ant.bat usage）&lt;br&gt;i.Debug静态库&lt;br&gt;d:\apache-ant\bin\ant.bat build -Ddebug=true -Dlib.type=static -Dhas.wchar_t=0&lt;br&gt;ii.Debug动态库&lt;br&gt;d:\apache-ant\bin\ant.bat build -Ddebug=true -Dlib.type=shared -Dhas.wchar_t=0&lt;br&gt;iii.Release静态库&lt;br&gt;d:\apache-ant\bin\ant.bat build -Ddebug=false -Dlib.type=static -Dhas.wchar_t=0&lt;br&gt;iv.Release动态库&lt;br&gt;d:\apache-ant\bin\ant.bat build -Ddebug=false -Dlib.type=shared -Dhas.wchar_t=0&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;3. 使用&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;a) 在IDE的包含目录中添加d:\build\log4cxx\include&lt;br&gt;b) 在项目属性中链接目录根据需要添加&lt;br&gt;D:\Build\log4cxx\build\debug\static\&lt;br&gt;D:\Build\log4cxx\build\debug\shared\&lt;br&gt;D:\Build\log4cxx\build\release\static\&lt;br&gt;D:\Build\log4cxx\build\release\shared\&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;4. 脚本自动安装方法&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;a) 在 &amp;quot;D:\Build\log4cxx\&amp;quot; 目录下建立distribute_libs.bat 内容如下：&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;-------------begin&lt;br&gt;@echo off&lt;/div&gt;
&lt;div&gt;echo Copying Debug shared dll libs...&lt;br&gt;copy build\debug\shared\log4cxxd.dll lib\log4cxxd.dll /Y&lt;br&gt;copy build\debug\shared\log4cxxd.lib lib\log4cxxd.lib /Y&lt;/div&gt;
&lt;div&gt;REM Debug static&lt;br&gt;echo Copying Debug static libs...&lt;br&gt;copy build\debug\static\log4cxxd.lib lib\log4cxxSd.lib /Y&lt;br&gt;copy build\debug\static\apr-1d.lib lib\apr-1Sd.lib /Y&lt;br&gt;copy build\debug\static\aprutil-1d.lib lib\aprutil-1Sd.lib /Y&lt;/div&gt;
&lt;div&gt;REM Release shared dll&lt;br&gt;echo Copying Release shared dll libs...&lt;br&gt;copy build\release\shared\log4cxx.dll lib\log4cxx.dll /Y&lt;br&gt;copy build\release\shared\log4cxx.lib lib\log4cxx.lib /Y&lt;/div&gt;
&lt;div&gt;REM Release static&lt;br&gt;echo Copying Release static libs...&lt;br&gt;copy build\release\static\log4cxx.lib lib\log4cxxS.lib /Y&lt;br&gt;copy build\release\static\apr-1.lib lib\apr-1S.lib /Y&lt;br&gt;copy build\release\static\aprutil-1.lib lib\aprutil-1S.lib /Y&lt;/div&gt;
&lt;div&gt;---------end of distribute_libs.bat&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;这样把所有有用的lib和dll放在log4cxx的lib目录下，并改成与类型对应的名字，在项目中就可以直接将链接目录指向lib，链接的库也可以用#pragma写到头文件中：&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#ifdef LOG4CXX_STATIC&lt;br&gt;# ifdef _DEBUG&lt;br&gt;#  pragma comment(lib, &amp;quot;log4cxxSd.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;apr-1Sd.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;aprutil-1Sd.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;ws2_32.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;Mswsock.lib&amp;quot;)&lt;br&gt;# else&lt;br&gt;#  pragma comment(lib, &amp;quot;log4cxxS.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;apr-1S.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;aprutil-1S.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;ws2_32.lib&amp;quot;)&lt;br&gt;#  pragma comment(lib, &amp;quot;Mswsock.lib&amp;quot;)&lt;br&gt;# endif&lt;br&gt;#else&lt;br&gt;# ifdef _DEBUG&lt;br&gt;#  pragma comment(lib, &amp;quot;log4cxxd.lib&amp;quot;)&lt;br&gt;# else&lt;br&gt;#  pragma comment(lib, &amp;quot;log4cxx.lib&amp;quot;)&lt;br&gt;# endif&lt;br&gt;#endif&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;update：&lt;/strong&gt;一直到 07 年 7 月的 SVN 代码，我都可以用上面的方法正确编译，我手头相关软件的版本分别是：ant 1.6.5 ant-contrib 1.0b2 cpptasks 1.0b4 apr 1.2.7 apr-util 1.2.7 cppunit 1.10.2。之后一直到 0.10.0 的 rc2 出来之前，我都没有从服务器上同步过代码，够用就好：）&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85+log4cxx+%e7%9a%84+SVN+%e7%89%88%e6%9c%ac&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!449.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!449.entry</guid><pubDate>Wed, 25 Oct 2006 05:25:39 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!449/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!449.entry#comment</wfw:comment><dcterms:modified>2008-02-27T06:05:21Z</dcterms:modified></item><item><title>编译log4cxx-0.9.7时发生链接错误</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!446.entry</link><description>&lt;p&gt; 把东西直接下载到桌面，除了不美观，有时还会导致一些奇怪的问题... 
&lt;p&gt;引用 
&lt;blockquote&gt;&lt;a href="http://luonjtu.spaces.live.com/blog/cns!6D623D583CFD3570!136.entry"&gt;编译log4cxx-0.9.7发生cannot open input file &amp;quot;and.obj&amp;quot;错误&lt;/a&gt;&lt;br&gt;
&lt;div&gt;编译log4cxx-0.9.7发生LINK : fatal error LNK1181: cannot open input file &amp;quot;and.obj&amp;quot;错误&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;今天想在一个测试工程里用log4cxx，让我想起刚接触log4cxx时遇到的一个问题。当时我在网站下载log4cxx后就开始用vc编译，结果老是出现LINK : fatal error LNK1181: cannot open input file &amp;quot;and.obj&amp;quot;错误，让人莫名其妙，上网找了一圈也没有结果，搞笑的是有个老外也在一个论坛提出了这个问题，但是没人解答。后来过了一段时间我再编译的时候却成功了。仔细研究了一下终于发现了原因，原来我第一次是把源文件放在桌面上编译的，而第二次是把源文件放在D盘后编译的，而桌面的路径是带空格的。事情终于弄清楚了－－log4cxx-0.9.7的vc工程不支持有空格的路径。虽然windows本身处理有空格的路径是没有问题的，但还是有不少应用程序有些问题－－我记得以前的JBuilder就是。看来没事还是最好不要使这种用含特殊字符的路径。&lt;/div&gt;&lt;/blockquote&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e7%bc%96%e8%af%91log4cxx-0.9.7%e6%97%b6%e5%8f%91%e7%94%9f%e9%93%be%e6%8e%a5%e9%94%99%e8%af%af&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!446.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!446.entry</guid><pubDate>Tue, 17 Oct 2006 06:41:16 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!446/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!446.entry#comment</wfw:comment><dcterms:modified>2006-10-18T13:47:53Z</dcterms:modified></item><item><title>XP的快速用户切换</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!445.entry</link><description>&lt;p&gt;也就是Fast User Switching，和服务器版Windows中的终端服务（Terminal Services）相比较，除了功能弱，细节上也有一些不同，虽然MSDN中说“Fast user switching is implemented using Terminal Services sessions”。 &lt;p&gt;调用CreateMutex创建命名互斥量时，可以在互斥量名称前面加上“Global\”表示该互斥量是全局唯一的（across all sessions）。 &lt;p&gt;在2003上，在任何一个会话（sesssion）中创建一个全局的命名互斥量，在其它任何会话（包括当前会话）中再次创建同名互斥量，均会返回第一次创建的结果，并且调用GetLastError会得到ERROR_ALREADY_EXISTS。 &lt;p&gt;而在XP上，第一次创建成功之后的调用，如果是当前会话，则会返回第一次创建的结果，如果是其它会话，则返回空值。 &lt;p&gt;如果打算利用互斥量来保证应用程序在计算机上只有一个运行实例，需要注意一下这个区别。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+XP%e7%9a%84%e5%bf%ab%e9%80%9f%e7%94%a8%e6%88%b7%e5%88%87%e6%8d%a2&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!445.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!445.entry</guid><pubDate>Mon, 16 Oct 2006 10:59:47 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!445/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!445.entry#comment</wfw:comment><dcterms:modified>2006-10-16T11:00:34Z</dcterms:modified></item><item><title>安装新版本MSDN碰到的问题</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!437.entry</link><description>&lt;div&gt;MSDN.Library.July.2006.DVD.Simplified.Chinese&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;辛辛苦苦安装好后没法运行，报错：&lt;/div&gt;
&lt;div&gt;无法显示Microsoft文档资源管理器，因为指定的帮助集合“ms-help://MS.MSDNQTR.v80.chs”无效。&lt;/div&gt;
&lt;div&gt;上网查了一下，也没找到什么解决方法。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;那就卸载吧，看到添加删除程序里有两项分别是Microsoft Document Explorer及其中文语言包，应该是装MSDN时自动装好的（会先询问要不要装这个），反正MSDN也不能用，就全部卸载了。然后突发奇想，再次安装这个版本的MSDN，居然就可以用了！&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;回想一下，可能是因为以前我在这台机器上安装过英文版的VS2005（包括MSDN），然后可能两个版本的Document Explorer有些冲突之类的，下回需要用2005的时候再研究一下吧。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;后记：这个版本是配合VS2005使用的，不能在VS2003的IDE中启动，有些麻烦，预谋卸载ing...&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e5%ae%89%e8%a3%85%e6%96%b0%e7%89%88%e6%9c%acMSDN%e7%a2%b0%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!437.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!437.entry</guid><pubDate>Fri, 22 Sep 2006 09:03:46 GMT</pubDate><slash:comments>2</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!437/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!437.entry#comment</wfw:comment><dcterms:modified>2006-09-23T04:22:02Z</dcterms:modified></item><item><title>The Free Lunch Is Over</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!427.entry</link><description>&lt;div&gt;原文：&lt;a href="http://www.gotw.ca/publications/concurrency-ddj.htm"&gt;The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;中文：&lt;a href="http://blog.csdn.net/hsutter/archive/2006/08/29/1136281.aspx"&gt;免费午餐已经结束——软件历史性地向并发靠拢&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;题外：不知道啥时候能吃上“扣肉”;-)&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+The+Free+Lunch+Is+Over&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!427.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!427.entry</guid><pubDate>Tue, 29 Aug 2006 05:36:33 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!427/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!427.entry#comment</wfw:comment><dcterms:modified>2006-09-05T09:00:32Z</dcterms:modified></item><item><title>纯资源DLL的入口函数问题</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!407.entry</link><description>&lt;div&gt;纯资源DLL的项目中一般没有代码文件，在链接时会报一个 LNK2001 的错误，解决方法：&lt;/div&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;1&lt;/strong&gt;：加个代码文件，内容如下，比较土。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;#include &amp;lt;windows.h&amp;gt;&lt;br&gt;&lt;br&gt;extern &amp;quot;C&amp;quot;&lt;br&gt;BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID )&lt;br&gt;{&lt;br&gt;    return 1;&lt;br&gt;}&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;2&lt;/strong&gt;：在项目属性的 Link 页中加入 msvcrt.lib，编译器就会去 msvcrt.dll 里面找入口函数了，还是有点土...&lt;/div&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;3&lt;/strong&gt;： 在 Link Options 中加入 /NOENTRY 即可！&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;题外：最近找到一本电子书是 djvu 格式的，用 &lt;a href="http://windjview.sourceforge.net/"&gt;WinDjView&lt;/a&gt; 可以看，然后发现新版本已经支持多种界面语言，但网站上还没有中文版本的资源文件，大概看了看汉化的步骤，不是太麻烦，就开工了...在快要完工时，无意在网上发现已经有人做了这个工作，真是郁闷，为啥不提交给原作者呢...&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e7%ba%af%e8%b5%84%e6%ba%90DLL%e7%9a%84%e5%85%a5%e5%8f%a3%e5%87%bd%e6%95%b0%e9%97%ae%e9%a2%98&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!407.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!407.entry</guid><pubDate>Tue, 18 Jul 2006 04:18:44 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!407/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!407.entry#comment</wfw:comment><dcterms:modified>2006-07-18T04:18:44Z</dcterms:modified></item><item><title>Python和Perl的笑话</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!176.entry</link><description>&lt;div&gt;刚才看到的...很强 ;-)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Q: 在python里边怎么获得一个随机的字符串? &lt;/div&gt;
&lt;div&gt;A: 读入一个perl文件&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+Python%e5%92%8cPerl%e7%9a%84%e7%ac%91%e8%af%9d&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!176.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!176.entry</guid><pubDate>Wed, 30 Nov 2005 00:14:08 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!176/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!176.entry#comment</wfw:comment><dcterms:modified>2005-11-30T00:14:08Z</dcterms:modified></item><item><title>[整理] 用VC6进行UNICODE编程</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!171.entry</link><description>&lt;p&gt;最近试图将自己的程序编译成Unicode版本，费了不少力气，相关内容整理如下，适用于VC6，但VC7、VC8应该也差不多的（后者新建项目缺省即按Unicode编译）。
&lt;p&gt;1. 添加 UNICODE 和 _UNICODE 预处理定义
&lt;p&gt;位置：Project Settings -&amp;gt; C/C++ -&amp;gt; Preprocessor definitions
&lt;p&gt;添加了这两个定义后，MFC的一些内置类型如 TCHAR、CString 都将转为支持宽字符类型（wchar_t）
&lt;p&gt;2. 使用宽字符相关类型，如：
&lt;p&gt;char -&amp;gt; TCHAR、char * -&amp;gt; LPTSTR、const char * -&amp;gt; LPCTSTR
&lt;p&gt;3. 对字符串常量使用 _T() 宏
&lt;p&gt;4. 替换C库中的中字符串操作函数，如 strlen -&amp;gt; _tcslen、strcmp -&amp;gt; _tcscmp 等
&lt;p&gt;类似的还有C库中字符串与数字的转换函数，如 atoi -&amp;gt; _ttoi、itoa -&amp;gt; _itot 等
&lt;p&gt;5. 将 Project Settings -&amp;gt; Link -&amp;gt; Output -&amp;gt; Entry Point 设为 wWinMainCRTSTartup
&lt;p&gt;否则会有如下错误：&lt;br&gt;msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol &lt;a href="mailto:_WinMain@16"&gt;_WinMain@16&lt;/a&gt;
&lt;p&gt;6. C++标准库中的string，有对应的宽字符版本wstring，两者均为basic_string的特化版本
&lt;p&gt;可在StdAfx.h中：
&lt;p&gt;#ifdef _UNICODE&lt;br&gt;#define tstring wstring&lt;br&gt;#else&lt;br&gt;#define tstring string&lt;br&gt;#endif
&lt;p&gt;然后在代码中使用 tstring 即可，类似的还有 fstream/wfstream、ofstream/wofstream 等
&lt;p&gt;7. 宽字符版本的英文字符仍可直接与整型值进行比较，如：
&lt;p&gt;CString s = _T(&amp;quot;ABC&amp;quot;);&lt;br&gt;ASSERT(s[0] == 'A');
&lt;p&gt;8. 对于仍需使用ANSI字符串的地方，如第三方类库的接口，仍可继续使用；如需进行Unicode字符串和ANSI字符串的互转换，可使用 MultiByteToWideChar 和 WideCharToMultiByte&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%5b%e6%95%b4%e7%90%86%5d+%e7%94%a8VC6%e8%bf%9b%e8%a1%8cUNICODE%e7%bc%96%e7%a8%8b&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!171.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!171.entry</guid><pubDate>Sun, 20 Nov 2005 06:12:18 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!171/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!171.entry#comment</wfw:comment><dcterms:modified>2005-11-21T09:52:42Z</dcterms:modified></item><item><title>理解AfxGetMainWnd</title><link>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!115.entry</link><description>&lt;div&gt;昨天在尝试用vs2003编译vc6的程序时碰到个问题，对话框应用程序，主对话框提供如下的Get方法：&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;long CMainDlg::GetHandle(int nChannel)&lt;br&gt;{&lt;br&gt; if (IsValidChannel(nChannel))&lt;br&gt;  return m_lHandle[nChannel];&lt;br&gt; else&lt;br&gt;  return -1;&lt;br&gt;}&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;inline BOOL CServerDlg::IsValidChannel(int nChannel)&lt;br&gt;{&lt;br&gt; return ((nChannel &amp;gt; -1) &amp;amp;&amp;amp; (nChannel &amp;lt; m_nChannelSum));&lt;br&gt;}&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;其中m_lHandle和m_nChannelSum均为主对话框的private成员&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;主对话框启动了一个工作线程，线程中需调用上述的GetHandle&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;方法1.&lt;/div&gt;
&lt;div&gt;CMainDlg* pDlg = (CMainDlg *)AfxGetMainWnd();&lt;br&gt;pDlg-&amp;gt;GetHandle(nChannel);&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;vc6 ok&lt;br&gt;vc7 crash，在调用到IsValidChannel的时候报Access violation，应该是不能访问m_nChannelSum&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;方法2.&lt;/div&gt;
&lt;div&gt;CMainDlg* pDlg = reinterpret_cast&amp;lt;CMainDlg *&amp;gt;pParam;&lt;br&gt;pDlg-&amp;gt;GetHandle(nChannel);&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;vc6&amp;amp;vc7均ok&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;刚开始一直错以为是reinterpret_cast的奥妙，原来是AfxGetMainWnd的问题。&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;MSDN中的说明:&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;If your application is an OLE server, call this function to retrieve a pointer to the active main window of the application instead of directly referring to the &lt;strong&gt;m_pMainWnd&lt;/strong&gt; member of the application object.
&lt;p&gt;If your application is not an OLE server, then calling this function is equivalent to directly referring to the &lt;b&gt;m_pMainWnd&lt;/b&gt; member of your application object.
&lt;p&gt; 
&lt;p&gt;至于是不是OLE server，看C***App::InitInstance中有没有调用AfxEnableControlContainer()&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=8460845320381072468&amp;page=RSS%3a+%e7%90%86%e8%a7%a3AfxGetMainWnd&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yin-gang.spaces.live.com&amp;amp;GT1=yin-gang"&gt;</description><comments>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!115.entry#comment</comments><guid isPermaLink="true">http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!115.entry</guid><pubDate>Wed, 14 Sep 2005 04:26:37 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yin-gang.spaces.live.com/blog/cns!756AF5FDCCD70454!115/comments/feed.rss</wfw:commentRss><wfw:comment>http://yin-gang.spaces.live.com/Blog/cns!756AF5FDCCD70454!115.entry#comment</wfw:comment><dcterms:modified>2005-10-13T07:14:16Z</dcterms:modified></item></channel></rss>