<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[qpsoft's Blog]]></title> 
<link>http://www.qpsoft.com/blog/index.php</link> 
<description><![CDATA[QPSOFT.COM]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[qpsoft's Blog]]></copyright>
<item>
<link>http://www.qpsoft.com/blog/codeblocks-vc-precompiled-header-config/</link>
<title><![CDATA[Code::Blocks+VC9支持预编译(Precompiled Header)]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Windows开发]]></category>
<pubDate>Wed, 03 Dec 2008 02:27:11 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/codeblocks-vc-precompiled-header-config/</guid> 
<description>
<![CDATA[ 
	Code::Blocks如果使用GCC编译器，那么Precompiled Header的支持是很容易的，官方Wiki上也有明确说明。下面要讨论的是VC9的预编译头文件如何在Code::Blocks上配置。<br/>这里有官方论坛的一篇帖子，讲解了如何配置，虽然可用，但还是有一些问题：每修改一处，都要重新编译一次pch.obj，这会很浪费时间：<a href="http://forums.codeblocks.org/index.php/topic,3421.0.html" target="_blank">http://forums.codeblocks.org/index.php/topic,3421.0.html</a><br/>于是决定加入.cpp文件，将wx_pch.h上的设置都放到wx_pch.cpp中，并且修改一下该文件的单独编译配置：<div class="quote"><div class="quote-title">引用</div><div class="quote-content">$compiler /nologo $options $includes /c $file /Yc"pch.h" /Fo$(OBJ)&#92;main&#92;pch.obj</div></div><br/>再加入编译选项：<div class="quote"><div class="quote-title">引用</div><div class="quote-content">/FI"pch.h"<br/>/Yu"pch.h"<br/>/Fp"$(OBJ)&#92;$(PROJECT_NAME).pch"</div></div><br/>好了，可以实现和VC一样的预编译头文件了：速度真的飞快！<br/>Tags - <a href="http://www.qpsoft.com/blog/tags/codeblocks/" rel="tag">codeblocks</a> , <a href="http://www.qpsoft.com/blog/tags/%25E9%25A2%2584%25E7%25BC%2596%25E8%25AF%2591/" rel="tag">预编译</a> , <a href="http://www.qpsoft.com/blog/tags/precompiled/" rel="tag">precompiled</a> , <a href="http://www.qpsoft.com/blog/tags/vc9/" rel="tag">vc9</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/boost-link-error-date_time/</link>
<title><![CDATA[奇怪的Boost链接错误]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Boost]]></category>
<pubDate>Wed, 03 Dec 2008 02:11:45 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/boost-link-error-date_time/</guid> 
<description>
<![CDATA[ 
	手上有一个工程，用到了boost，之前编译链接一切正常。但在将该工程加入Precompiled Header支持后，出现了奇怪的链接错误：<div class="quote"><div class="quote-title">引用</div><div class="quote-content">about.obj&#124;&#124;error LNK2001: unresolved external symbol "public: static class std::locale::id boost::date_time::date_facet<class boost::gregorian::date,char,class std::ostreambuf_iterator<char,struct std::char_traits<char> > >::id" (?id@?$date_facet@Vdate@gregorian@boost@@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@date_time@boost@@2V0locale@std@@A)&#124;</div></div><br/>看提示，应该是date_time库链接出了问题。奇怪！<br/>看支持Precompiled Header的pch.h（常见的是StdAfx.h）头文件，发现里面有这一句：<div class="code">#include &lt;boost/date_time.hpp&gt;</div>难道是date_time.hpp不能放在pch.h中？<br/>将该文件从pch.h中移除，重编译链接，一切正常。<br/>Tags - <a href="http://www.qpsoft.com/blog/tags/boost/" rel="tag">boost</a> , <a href="http://www.qpsoft.com/blog/tags/%25E9%2593%25BE%25E6%258E%25A5%25E9%2594%2599%25E8%25AF%25AF/" rel="tag">链接错误</a> , <a href="http://www.qpsoft.com/blog/tags/date_time/" rel="tag">date time</a> , <a href="http://www.qpsoft.com/blog/tags/%25E9%25A2%2584%25E7%25BC%2596%25E8%25AF%2591/" rel="tag">预编译</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/boost-build-cmd-no-vc/</link>
<title><![CDATA[不安装VC，命令行下编译Boost]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Boost]]></category>
<pubDate>Tue, 02 Dec 2008 09:27:22 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/boost-build-cmd-no-vc/</guid> 
<description>
<![CDATA[ 
	还是决定使用Code::Blocks，尽管智能提示功能很弱：但看中其跨平台和免安装（便携）且节省至少1G的C盘空间（即使VCExpress+.NET3.5）。于是自己架上了GCC4.3.2编译环境，自己编译Code::Blocks最新的SVN版本，决定边学Code::Blocks的源码，边写Life++ 3.x！<br/>生活在继续，学习无止境！看着儿子身体逐渐康复，看着他可爱的身影，内心充满了动力！！<br/>下面将在命令行下使用VC2008编译器（从VC2008Express中提取）编译boost 1.37版本。<br/>一、用批处理配置命令行<div class="code">set PATH=%CD%&#92;bin;%PATH%<br/>set INCLUDE=%CD%&#92;include<br/>set LIB=%CD%&#92;lib</div><br/>二、自定义boost的编译选项、链接选项<br/>打开tools&#92;build&#92;v2&#92;user-config.jam，查找MSVC configuration，<br/><div class="code"># Configure specific msvc version for QPSOFT.COM<br/>using msvc : 9.0 : &quot;cl.exe&quot; : <br/>&lt;compileflags&gt;/wd4819<br/>&lt;compileflags&gt;/D_CRT_SECURE_NO_DEPRECATE<br/>&lt;compileflags&gt;/D_SCL_SECURE_NO_DEPRECATE <br/>&lt;compileflags&gt;/D_CRT_NONSTDC_NO_DEPRECATE<br/>&lt;compileflags&gt;/D_SECURE_SCL=0<br/>&lt;linkflags&gt;/MANIFEST:NO<br/>&lt;linkflags&gt;/OPT:REF<br/>&lt;linkflags&gt;/OPT:ICF<br/>&lt;linkflags&gt;/IGNORE:4089 ;</div><br/>三、通过cmd，执行该批处理，并在命令行下执行以下步骤<br/>1. 编译bjam工具：进入tools&#92;jam&#92;src，执行 build.bat ，完成后在tools&#92;jam&#92;src&#92;bin.ntx86下得到bjam.exe<br/>2. 将bjam.exe拷贝到boost解压目录下，编译相应库：<div class="code">bjam --with-signals --with-filesystem --with-date_time --with-thread --with-system --build-type=complete threading=multi runtime-link=static --libdir=&quot;.&#92;lib&quot; --toolset=msvc-9.0 stage</div>编译完成后可在stage/lib目录下看到编译完成的BOOST库。<br/>3. 将bjam.exe拷贝到tools&#92;bcp目录下，执行bjam编译bcp工具，用于提取所需的头文件，完成后在bin.v2&#92;tools&#92;bcp&#92;msvc-9.0&#92;release&#92;link-static&#92;runtime-link-static&#92;threading-multi下可见bcp.exe<br/>4. 拷贝bcp.exe到boost解压目录下，并创建新目录foo，提取所需要的头文件：<div class="code">bcp boost/lexical_cast.hpp boost/cast.hpp boost/filesystem.hpp boost/format.hpp boost/scoped_ptr.hpp boost/scoped_array.hpp boost/shared_array.hpp boost/intrusive_ptr.hpp boost/static_assert.hpp boost/lambda/lambda.hpp boost/filesystem.hpp boost/variant.hpp boost/algorithm/string.hpp boost/signals.hpp boost/date_time.hpp boost/thread.hpp boost/asio.hpp foo</div><br/>发现问题，随时用bjam --help查询。<br/>Tags - <a href="http://www.qpsoft.com/blog/tags/boost/" rel="tag">boost</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AE%2589%25E8%25A3%2585/" rel="tag">安装</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%2591%25BD%25E4%25BB%25A4%25E8%25A1%258C/" rel="tag">命令行</a> , <a href="http://www.qpsoft.com/blog/tags/%25E4%25B8%258D%25E5%25AE%2589%25E8%25A3%2585vc/" rel="tag">不安装vc</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/life/</link>
<title><![CDATA[Life++ 2.2.3.1]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[共享软件]]></category>
<pubDate>Sat, 29 Nov 2008 13:20:08 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/life/</guid> 
<description>
<![CDATA[ 
	&nbsp;&nbsp;&nbsp;&nbsp;Life++使用高效的C++编写，低CPU资源消耗，低内存占用（800K左右），不依赖运行库就可在Win2000、WinXP、Win2003、Vista32下很好的工作。软件集强制休息、时段控制、定时提醒、新邮件提醒、定时关机、窗口隐藏功能于一身，可很好的为您的生活服务。<br/><a href="http://www.qpsoft.com/blog/attachment.php?fid=11" target="_blank"><img src="http://www.qpsoft.com/blog/attachment.php?fid=11" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><a href="http://www.qpsoft.com/downloads/Life++_2.2.exe">点击这里下载文件</a>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF;">适用人群：</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;⒈ 长期工作在电脑前，Life++是您的好秘书<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒉ 孩子特别爱玩电脑，Life++是您的好管家<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF;">软件特点：</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;⒈ 自我保护能力强，非管理员无法退出本软件<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒉ 低CPU消耗、低内存占用、多功能、小体积<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒊ 多语言，支持插件形式的功能扩充<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF;">主要功能：</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;⒈ 工作指定时间后强制休息：保护眼睛，呵护健康<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒉ 限定每天在电脑前工作的总时间<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒊ 限制每天可以使用电脑的时间段：家长管理孩子的好助手<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒋ 定时提醒、每日、每周、每月、每年提醒：电脑前工作的好秘书<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒌ 新邮件提醒，及时与外界勾通互动<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒍ 定时关机、闲置关机、低网速关机、闲置关闭显示器<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒎ 窗口隐藏，快捷又方便：保护隐私的最佳选择<br/>&nbsp;&nbsp;&nbsp;&nbsp;⒏ 插件，功能扩充将变得如此简单<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF;">特别声明：</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;Life++从Mini Assistant（以下简称MA）的设计思路出发，历经三次重写所有代码的艰难历程，本着精益求精的态度而诞生。Life++ 2.0 正式版发布之前的MA注册用户可以免费升级到Life++，但之后注册MA的用户则无法免费升级到Life++。<br/><br/><br/>Tags - <a href="http://www.qpsoft.com/blog/tags/life%252B%252B/" rel="tag">life++</a> , <a href="http://www.qpsoft.com/blog/tags/%25E8%25BD%25AF%25E4%25BB%25B6/" rel="tag">软件</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%259C%25BC%25E7%259D%259B%25E5%258D%25AB%25E5%25A3%25AB/" rel="tag">眼睛卫士</a> , <a href="http://www.qpsoft.com/blog/tags/%25E4%25BF%259D%25E6%258A%25A4%25E7%259C%25BC%25E7%259D%259B/" rel="tag">保护眼睛</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25BC%25BA%25E5%2588%25B6%25E4%25BC%2591%25E6%2581%25AF/" rel="tag">强制休息</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AE%259A%25E6%2597%25B6%25E5%2585%25B3%25E6%259C%25BA/" rel="tag">定时关机</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%25AA%2597%25E5%258F%25A3%25E9%259A%2590%25E8%2597%258F/" rel="tag">窗口隐藏</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AE%259A%25E6%2597%25B6%25E6%258F%2590%25E9%2586%2592/" rel="tag">定时提醒</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AE%25B6%25E9%2595%25BF%25E7%25AE%25A1%25E7%2590%2586/" rel="tag">家长管理</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%2594%25B5%25E8%2584%2591%25E5%2581%25A5%25E5%25BA%25B7/" rel="tag">电脑健康</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%2594%25B5%25E8%2584%2591%25E7%25AE%25A1%25E7%2590%2586/" rel="tag">电脑管理</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%2594%25B5%25E8%2584%2591%25E6%258E%25A7%25E5%2588%25B6/" rel="tag">电脑控制</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/nsis-is-user-admin-runas/</link>
<title><![CDATA[NSIS判断用户是否具有管理员权限]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Windows开发]]></category>
<pubDate>Sat, 29 Nov 2008 12:46:13 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/nsis-is-user-admin-runas/</guid> 
<description>
<![CDATA[ 
	其实很早就想让Life++的安装必须要求管理员权限，但由于一些原因一直没实现。今天在更新Life++到2.2.3.1时总算完成了很长时间以来的想法。Life++2.2.3.1这个版本将强制休息前的提醒时间最小值设置为1秒：没设计为零的原因：代码更改很麻烦，怕影响稳定性。看来禁止锁前提醒功能只能放到3.x版本来实现了。<br/>以下是关于NSIS判断当前用户是否具有管理员权限的信息：<div class="quote"><div class="quote-title">引用</div><div class="quote-content">http://nsis.sourceforge.net/IsUserAdmin<br/><a href="http://nsis.sourceforge.net/NSIS-RunAs" target="_blank">http://nsis.sourceforge.net/NSIS-RunAs</a><br/></div></div><div class="code">; Usage:<br/>;&nbsp;&nbsp; Call IsUserAdmin<br/>;&nbsp;&nbsp; Pop $R0&nbsp;&nbsp; ; at this point $R0 is &quot;true&quot; or &quot;false&quot;<br/>;<br/>Function IsUserAdmin<br/>Push $R0<br/>Push $R1<br/>Push $R2<br/> <br/>ClearErrors<br/>UserInfo::GetName<br/>IfErrors Win9x<br/>Pop $R1<br/>UserInfo::GetAccountType<br/>Pop $R2<br/> <br/>StrCmp $R2 &quot;Admin&quot; 0 Continue<br/>; Observation: I get here when running Win98SE. (Lilla)<br/>; The functions UserInfo.dll looks for are there on Win98 too, <br/>; but just don&#039;t work. So UserInfo.dll, knowing that admin isn&#039;t required<br/>; on Win98, returns admin anyway. (per kichik)<br/>; MessageBox MB_OK &#039;User &quot;$R1&quot; is in the Administrators group&#039;<br/>StrCpy $R0 &quot;true&quot;<br/>Goto Done<br/> <br/>Continue:<br/>; You should still check for an empty string because the functions<br/>; UserInfo.dll looks for may not be present on Windows 95. (per kichik)<br/>StrCmp $R2 &quot;&quot; Win9x<br/>StrCpy $R0 &quot;false&quot;<br/>;MessageBox MB_OK &#039;User &quot;$R1&quot; is in the &quot;$R2&quot; group&#039;<br/>Goto Done<br/> <br/>Win9x:<br/>; comment/message below is by UserInfo.nsi author:<br/>; This one means you don&#039;t need to care about admin or<br/>; not admin because Windows 9x doesn&#039;t either<br/>;MessageBox MB_OK &quot;Error! This DLL can&#039;t run under Windows 9x!&quot;<br/>StrCpy $R0 &quot;true&quot;<br/> <br/>Done:<br/>;MessageBox MB_OK &#039;User= &quot;$R1&quot;&nbsp;&nbsp;AccountType= &quot;$R2&quot;&nbsp;&nbsp;IsUserAdmin= &quot;$R0&quot;&#039;<br/> <br/>Pop $R2<br/>Pop $R1<br/>Exch $R0<br/>FunctionEnd</div><br/>Tags - <a href="http://www.qpsoft.com/blog/tags/nsis/" rel="tag">nsis</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AE%2589%25E8%25A3%2585/" rel="tag">安装</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%25AE%25A1%25E7%2590%2586%25E5%2591%2598%25E6%259D%2583%25E9%2599%2590/" rel="tag">管理员权限</a> , <a href="http://www.qpsoft.com/blog/tags/%25E6%259D%2583%25E9%2599%2590%25E5%2588%25A4%25E6%2596%25AD/" rel="tag">权限判断</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/svn-subversion-quick-start/</link>
<title><![CDATA[将项目交给SVN进行版本管理]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Windows开发]]></category>
<pubDate>Wed, 26 Nov 2008 02:00:26 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/svn-subversion-quick-start/</guid> 
<description>
<![CDATA[ 
	开始将项目转由SVN管理，包括正在开发的Life++ 3.x版本。自学编程有几年了，但进展缓慢，也浪费了很多时间。近期终于明白：项目交给SVN进行版本管理的好处！下面简要总结SVN的使用。以下操作全在命令行下进行且本机使用：我不喜欢图形界面。<br/><br/>一、基本概念<br/>拷贝：从SVN版本库获取工作拷贝的过程。将会把所有的工作文件放入一个文件夹中。<br/>工作拷贝：名词，从SVN版本库中得到的一份工作文件集合。工作拷贝中会包含.svn文件夹，其中记录了原始文件，当修改时也会有所发觉。工作时就是对工作拷贝进行修改。<br/>合并：将已经修改过的工作拷贝提交到SVN版本库的过程。<br/>SVN版本库：用于存储工作拷贝文件集的仓库，对外提供一定的接口供SVN客户端使用。对外接口可以是文件系统、SVN服务、apache插件提供的SVN服务等等。一定要区别SVN版本库和工作拷贝。SVN版本库是一个数据库，其中的内容不推荐访问，更不要改动，在这里一般也找不到你的工作文件。<br/><br/>二、常见操作<br/>创建版本库：<div class="code">svnadmin create 版本库路径 （例如：file:///d:/qpsoft/projectName）</div><br/>导入当前项目到版本库：<div class="code">svn import -m &quot;导入说明&quot; 要导入的项目路径 版本库路径</div><br/>常见修改命令：<div class="code">svn add、svn delete、svn copy、svn move、svn mkdir</div><br/>首次使用一定要先检出工作拷贝：<div class="code">svn checkout 版本库路径 目标路径</div><br/>检查工作拷贝状态：<div class="code">svn status</div><br/>查看当前修改内容：<div class="code">svn diff&nbsp;&nbsp;文件名 或 svn diff 文件名 &gt; 重定向的文件名</div><br/>取消相应文件的修改：<div class="code">svn revert 文件路径/文件名</div><br/>提交修改后的工作拷贝到版本库：<div class="code">svn commit -m &quot;当前版本说明&quot;</div><br/>导出不含.svn目录的源代码：<div class="code">svn export 版本库路径 目标路径 </div><br/><br/>三、工作流程模型<br/>导入→检出→修改→提交→导出<br/>import →checkout→ 修改→commit→ export<br/>Tags - <a href="http://www.qpsoft.com/blog/tags/svn/" rel="tag">svn</a> , <a href="http://www.qpsoft.com/blog/tags/%25E7%2589%2588%25E6%259C%25AC%25E7%25AE%25A1%25E7%2590%2586/" rel="tag">版本管理</a> , <a href="http://www.qpsoft.com/blog/tags/subversion/" rel="tag">subversion</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/openoffice-language-pack/</link>
<title><![CDATA[OpenOffice.org 3.0 多国语言版]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[综合]]></category>
<pubDate>Mon, 17 Nov 2008 08:01:50 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/openoffice-language-pack/</guid> 
<description>
<![CDATA[ 
	通过语言文件，可以使用OpenOffice.org的任一种语言。由于这几个链接不太好找，所以记录下来备查。（注：搜索引擎可以通过关键词“OpenOffice.org language pack”来找到相关信息）<div class="quote"><div class="quote-title">引用</div><div class="quote-content">http://ftp.cse.yzu.edu.tw/pub/openoffice/extended/<br/><a href="ftp://ftp.jaist.ac.jp/pub/openoffice/extended/" target="_blank">ftp://ftp.jaist.ac.jp/pub/openoffice/extended/</a><br/><a href="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/extended/" target="_blank">ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/extended/</a><br/><a href="http://mirror.switch.ch/ftp/mirror/OpenOffice/extended/" target="_blank">http://mirror.switch.ch/ftp/mirror/OpenOffice/extended/</a><br/><a href="http://ftp-1.gwdg.de/pub/openoffice/extended/" target="_blank">http://ftp-1.gwdg.de/pub/openoffice/extended/</a></div></div><br/>下面是一篇关于OpenOffice.org 3.0文章，说的很好，供参考。<div class="quote"><div class="quote-title">引用</div><div class="quote-content">http://www.hfu.edu.tw/~kwc/CourseBulletin/SoftwareApplication/OOo.htm</div></div><br/><br/>Tags - <a href="http://www.qpsoft.com/blog/tags/openoffice.org/" rel="tag">openoffice.org</a> , <a href="http://www.qpsoft.com/blog/tags/language/" rel="tag">language</a> , <a href="http://www.qpsoft.com/blog/tags/pack/" rel="tag">pack</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/codeblocks-help-plugin-execute/</link>
<title><![CDATA[修改Code::Blocks代码，扩充帮助插件功能]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[wxWidgets]]></category>
<pubDate>Sun, 16 Nov 2008 10:40:29 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/codeblocks-help-plugin-execute/</guid> 
<description>
<![CDATA[ 
	Code::Blocks的帮助插件不支持可执行文件。比如我想使用我自己写的MSDN辅助查询软件，格式要求：<div class="code">msdn.exe 要查询的内容<br/>example： msdn.exe MessageBox</div>然后使用CB的帮助插件，最后显示的是“*”。<br/>没办法，只要checkout最新的源码，配置好GCC4.3.2编译器，编译之。经检查代码发现，只要：<div class="code">D:&#92;ycdeng&#92;qpcb&#92;codeblocks&#92;src&#92;plugins&#92;contrib&#92;help_plugin&#92;help_plugin.cpp<br/>line: 612<br/>add:<br/>&nbsp;&nbsp;&nbsp;&nbsp;if (ext.CmpNoCase(_T(&quot;exe&quot;)) == 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helpfile += _T(&quot; &quot;) + keyword;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wxExecute(helpfile);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;</div>就可以实现了。<br/>总结：由于是第一次修改大型软件的源码，以达到自己的功能需求，故感觉很爽，特记录一下。<br/>晕，原来是我不会配置：其实不用更改源码。<div class="quote"><div class="quote-title">引用</div><div class="quote-content">You can do this already:<br/>goto "Settings -> Environment -> Help Files"<br/>Click "Add" and name your new help entry.<br/>Choose "Yes" when prompted to browse for a help file.<br/>Browse for the executable.<br/>Add " $(keyword)" to the end of path.<br/>Check the boxes for "This is the default help file (shortcut: F1)" (optionally) and "This line represents a full command to be executed" (needed)<br/>Click "Ok"<br/><br/>Partly taken from the wiki (<a href="http://wiki.codeblocks.org/index.php?title=Using_devhelp_as_a_help_viewer)" target="_blank">http://wiki.codeblocks.org/index.php?title=Using_devhelp_as_a_help_viewer)</a> and slightly modified.</div></div><br/>Tags - <a href="http://www.qpsoft.com/blog/tags/codeblocks/" rel="tag">codeblocks</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25B8%25AE%25E5%258A%25A9%25E6%258F%2592%25E4%25BB%25B6/" rel="tag">帮助插件</a> , <a href="http://www.qpsoft.com/blog/tags/msdn/" rel="tag">msdn</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/gcc-thunk-map-message/</link>
<title><![CDATA[利用std::map实现消息路由]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Windows开发]]></category>
<pubDate>Sun, 16 Nov 2008 10:35:13 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/gcc-thunk-map-message/</guid> 
<description>
<![CDATA[ 
	前一段时间用thunk实现了Win32窗口的封装，但改用GCC编译器后，一大堆警告。才发现原来VC9的很多语法并非C++标准。好不容易才在GCC下编译成功，但程序运行崩溃！原因：不支持thunk，即thunk与编译器有关。<br/>去掉thunk，改用map实现消息路由，代码如下：<div class="code">static LRESULT CALLBACK stWndProc(HWND wnd, UINT msg, WPARAM wpa, LPARAM lpa)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (msg == WM_NCCREATE)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long p = reinterpret_cast&lt;long&gt;(reinterpret_cast&lt;LPCREATESTRUCT&gt;(lpa)-&gt;lpCreateParams);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(p);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (p != 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_thisMap.insert(std::pair&lt;HWND, long&gt;(wnd, p));<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T* pThis = reinterpret_cast&lt;T *&gt;(p);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pThis-&gt;_wnd = wnd;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::map&lt;HWND, long&gt;::const_iterator pos = _thisMap.find(wnd);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pos != _thisMap.end())<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T* pThis = reinterpret_cast&lt;T *&gt;(pos-&gt;second);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return pThis-&gt;wndProc(wnd, msg, wpa, lpa);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return ::DefWindowProc(wnd, msg, wpa, lpa);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;LRESULT CALLBACK wndProc(HWND wnd, UINT msg, WPARAM wpa, LPARAM lpa)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(_wnd == wnd);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LRESULT res = 0;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool ret = processWindowMessage(_wnd, msg, wpa, lpa, res);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ret) return res;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else return ::DefWindowProc(_wnd, msg, wpa, lpa);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;</div><br/>记录一下，供以后参考吧。<br/>Tags - <a href="http://www.qpsoft.com/blog/tags/gcc/" rel="tag">gcc</a> , <a href="http://www.qpsoft.com/blog/tags/thunk/" rel="tag">thunk</a> , <a href="http://www.qpsoft.com/blog/tags/%25E6%25B6%2588%25E6%2581%25AF%25E6%2598%25A0%25E5%25B0%2584/" rel="tag">消息映射</a>
]]>
</description>
</item><item>
<link>http://www.qpsoft.com/blog/boost-lexical_cast-subclass-wxtextctrl/</link>
<title><![CDATA[勉强：boost::lexical_cast技巧一则]]></title> 
<author>qpsoft &lt;info@qpsoft.com&gt;</author>
<category><![CDATA[Boost]]></category>
<pubDate>Fri, 31 Oct 2008 11:02:32 +0000</pubDate> 
<guid>http://www.qpsoft.com/blog/boost-lexical_cast-subclass-wxtextctrl/</guid> 
<description>
<![CDATA[ 
	今天在写一个作业统计的软件时，需要将相应的wxTextCtrl只能输入数字、空格以及横杠。如果用户输入了其他字符，则弹出窗口提示，并将不可以接受的字符删除。在设计时应用了一下boost::lexical_cast的异常机制：如果将纯字母转化成数字，将抛出异常，进而比较巧妙的解决了问题。<br/>附相关代码：<div class="code">void Frame::onAddKeyDown(wxKeyEvent&amp; event)<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;int key = event.GetKeyCode();<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;if (<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(key &gt;= 48 &amp;&amp; key &lt;= 57) // 0 - 9<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; (key &gt;= 324 &amp;&amp; key &lt;= 333) // 小键盘：0-9<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 8 // BackSpace<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 9 // Tab<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 27 // Esc<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 32 // 空格<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 45 // -<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&#124; key == 390 // 小键盘：-<br/>&nbsp;&nbsp;&nbsp;&nbsp;)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.Skip();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;::wxMessageBox(_T(&quot;只能输入数字（代表学号）、空格（分隔符）、横杠（代表范围），比如：1 6-18 22 36-39&quot;));<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qp::string str = _addId-&gt;GetValue();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qp::string tmp = str.substr(str.length() - 1, str.length());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 这里的处理是：如果抛出异常，说明不能转化成数字<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boost::lexical_cast&lt;int&gt;(tmp);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (...)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str = str.substr(0, str.length() - 1);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_addId-&gt;SetValue(str.c_str());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_addId-&gt;SetInsertionPointEnd();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/>&#125;</div><br/>Tags - <a href="http://www.qpsoft.com/blog/tags/boost/" rel="tag">boost</a> , <a href="http://www.qpsoft.com/blog/tags/lexical_cast/" rel="tag">lexical cast</a> , <a href="http://www.qpsoft.com/blog/tags/%25E5%25AD%2590%25E7%25B1%25BB%25E5%258C%2596/" rel="tag">子类化</a> , <a href="http://www.qpsoft.com/blog/tags/wxwidgets/" rel="tag">wxwidgets</a>
]]>
</description>
</item>
</channel>
</rss>