﻿<?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>学习日记 &#187; Gh0st 3.6</title>
	<atom:link href="https://www.softwareace.cn/?feed=rss2&#038;tag=gh0st-3-6" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>VS 2010编译Gh0st 3.6</title>
		<link>https://www.softwareace.cn/?p=64</link>
		<comments>https://www.softwareace.cn/?p=64#comments</comments>
		<pubDate>Tue, 15 Jan 2013 10:17:19 +0000</pubDate>
		<dc:creator><![CDATA[littlesu]]></dc:creator>
				<category><![CDATA[开发问题]]></category>
		<category><![CDATA[Gh0st 3.6]]></category>

		<guid isPermaLink="false">http://192.168.0.106/?p=64</guid>
		<description><![CDATA[&#160; 用Vs编译Gh0st修改的工作量还是挺大的，毕竟从VC6.0移植到VS2010平台，已经是一个很 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818705z4h2.gif" style="border: none; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);" /><span style="font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">&nbsp;</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	用Vs编译Gh0st修改的工作量还是挺大的，毕竟从VC6.0移植到VS2010平台，已经是一个很大的跨越了，VS2010相对于VC6.0也改进了不止一点了。Gh0st3.6使用了第三方界面库CJ60Lib，目前这个库只支持到VC6.0，而其后的版本已经商业化，所以使用VS2010编译Gh0st的时候，需要重新编译CJ60Lib。VS2010的自带安装的Windows&nbsp;SDK已经到了7.1版，也不需要像VC6.0那样需要下载Windows&nbsp;SDK，并配置环境了。VC6.0支持的最高版本的Windows&nbsp;SDK&nbsp;是Windows&nbsp;2003的，而VS2010自带的7.1版已经到了Windows&nbsp;Server&nbsp;2008&nbsp;了，其中发生的变化也是很大的。下面具体来操作一次。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;先列一下几个主要下文件路径。用的是Gh0s3.6原版，硬盘锁代码已经注释。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6&nbsp;<br />
	E:ProgrammingVS2010Gh0st3.6gh0st.dsw&nbsp;<br />
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60Lib&nbsp;<br />
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibCJ60LibCJ60Lib.dsw&nbsp;<br />
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibLib</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	一．编译<span style="font-family: Tahoma;">CJ60Lib</span><span style="font-family: 宋体;">库</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;直接用VS2010打开CJ60Lib.dsw进行转换。一共有7个，有4个是已经不存在的项目了，直接删掉。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818338b4Qr.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	在灰色的项目上点右键&ndash;Remove，或直接按Del键删除。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1编译CJ60StaticLib</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;直接在CJ60StaticLib项目上点右键&mdash;&nbsp;Project&nbsp;Only&nbsp;&mdash;-&nbsp;Build&nbsp;Only&nbsp;CJ60StaticLib或者是&nbsp;Rebuild&nbsp;Only&nbsp;CJ60StaticLib。以后说编译某个项目也是这样，不再重复说明了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818403Qj77.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.1</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	首先修改程序配置，让默认的字符都为ANSI字符，VS2010默认为宽字符Unicode版。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	项目&mdash;右键&mdash;属性&mdash;C/C++&mdash;Language&mdash;WChar_t&mdash;No，如图所示:</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改编译后，对照错误，再来一个一个的修改。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818435d3gP.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.2</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;&nbsp;stdafx.cpp&nbsp;<br />
	1&gt;&nbsp;_WIN32_WINNT&nbsp;not&nbsp;defined.&nbsp;Defaulting&nbsp;to&nbsp;_WIN32_WINNT_MAXVER&nbsp;(see&nbsp;WinSDKVer.h)<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stcj60libcj60libstdafx.h(51):&nbsp;fatal&nbsp;error&nbsp;C1083:&nbsp;无法打开包括文件:&ldquo;..srcafximpl.h&rdquo;:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	双击这个错误，定位到&nbsp;stdafx.h&nbsp;中的</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	#include&nbsp;&lt;..srcafximpl.h&gt;&nbsp;<br />
	把这句话改成&nbsp;<br />
	#include&nbsp;&lt;..srcmfcafximpl.h&gt;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.3</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	接着修改warning&nbsp;C4819警告</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	warning&nbsp;C4819:&nbsp;该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为&nbsp;Unicode格式以防止数据丢失</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这个警告至需要双击打开该文件，然后保存就可以了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.4</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	gh0st3.6gh0stcj60libcj60libsubclass.cpp(117):&nbsp;error&nbsp;C2065:&nbsp;&ldquo;p&rdquo;:&nbsp;未声明的标识符</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这是因为VS更符号C++标准，临时变量的作用域已经修正了，在Gh0st里，可以看到很多这样的代码。只要把在for或if里面定义的变量，放到for或if之前定义就好了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这里的代码是：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	for&nbsp;(CSubclassWnd*&nbsp;p&nbsp;=&nbsp;theHookMap.Lookup(m_hWnd);&nbsp;p;&nbsp;p=p-&gt;m_pNext)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改为</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	CSubclassWnd*&nbsp;p&nbsp;=&nbsp;NULL;&nbsp;<br />
	for&nbsp;(p&nbsp;=&nbsp;theHookMap.Lookup(m_hWnd);&nbsp;p;&nbsp;p=p-&gt;m_pNext)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	后面的i也是一样修改。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	gh0st3.6gh0stcj60libcj60libcoolmenu.cpp(803):&nbsp;error&nbsp;C2065:&nbsp;&ldquo;i&rdquo;:&nbsp;未声明的标识符</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	for&nbsp;(i=0;&nbsp;i&nbsp;&lt;&nbsp;nFound;&nbsp;i++)&nbsp;{</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这里的i，是在前面的&nbsp;<br />
	for&nbsp;(UINT&nbsp;i=0;&nbsp;i&lt;&nbsp;nItem;&nbsp;i++)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	里面定义的，只要把for里面的i放到for之前定义就可以了，修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	UINT&nbsp;i=0;&nbsp;<br />
	for&nbsp;(i=0;&nbsp;i&lt;&nbsp;nItem;&nbsp;i++)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这样的错误修改，以后不再写出，因为实在是太多了，修改方法也很简单。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.5</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	gh0st3.6gh0stcj60libcj60libcoolmenu.cpp(76):&nbsp;error&nbsp;C4430:&nbsp;缺少类型说明符&nbsp;&ndash;假定为&nbsp;int。注意:&nbsp;C++&nbsp;不支持默认&nbsp;int</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	在VC6.0里，用修饰符申明的变量可以不现式的写出变量类型，默认类型为int。如这里的const&nbsp;CXGAP&nbsp;=&nbsp;1;&nbsp;等于&nbsp;const&nbsp;int&nbsp;CXGAP&nbsp;=&nbsp;1;&nbsp;但是VS2010必须现式的指出，不能省略。所以修改方法就是现式的写上定义类型。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	//&nbsp;constants&nbsp;used&nbsp;for&nbsp;drawing</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;CXGAP&nbsp;=&nbsp;1;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;between&nbsp;button&nbsp;and&nbsp;text</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;CXTEXTMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;after&nbsp;hilite&nbsp;to&nbsp;start&nbsp;text</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;CXBUTTONMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;wider&nbsp;button&nbsp;is&nbsp;than&nbsp;bitmap</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;CYBUTTONMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;ditto&nbsp;for&nbsp;height</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	//&nbsp;constants&nbsp;used&nbsp;for&nbsp;drawing</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;int&nbsp;CXGAP&nbsp;=&nbsp;1;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;between&nbsp;button&nbsp;and&nbsp;text</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;int&nbsp;CXTEXTMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;after&nbsp;hilite&nbsp;to&nbsp;start&nbsp;text</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;int&nbsp;CXBUTTONMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;num&nbsp;pixels&nbsp;wider&nbsp;button&nbsp;is&nbsp;than&nbsp;bitmap</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	const&nbsp;int&nbsp;CYBUTTONMARGIN&nbsp;=&nbsp;2;&nbsp;//&nbsp;ditto&nbsp;for&nbsp;height</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这个在Gh0st里有，以后这个错误也不在指出。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.6</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	接下来要解决的就是一大堆的重定义错误了</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(126):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;tagSFBS_FLAGS&rdquo;:&ldquo;enum&rdquo;类型重定义&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(126)&nbsp;:&nbsp;参见&ldquo;tagSFBS_FLAGS&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(251):&nbsp;error&nbsp;C2084:&nbsp;函数&ldquo;HRESULT&nbsp;SHLocalStrDupW(LPCWSTR,LPWSTR&nbsp;*)&rdquo;已有主体&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(250)&nbsp;:&nbsp;参见&ldquo;SHLocalStrDupW&rdquo;的前一个定义&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(256):&nbsp;error&nbsp;C2084:&nbsp;函数&ldquo;HRESULT&nbsp;SHLocalStrDupA(LPCSTR,LPSTR&nbsp;*)&rdquo;已有主体&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(255)&nbsp;:&nbsp;参见&ldquo;SHLocalStrDupA&rdquo;的前一个定义&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(860):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_INVALID&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(860)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_INVALID&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(861):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_UNKNOWN&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(861)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_UNKNOWN&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(862):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_FTP&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(862)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_FTP&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(863):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_HTTP&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(863)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_HTTP&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(864):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_GOPHER&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(864)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_GOPHER&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(865):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_MAILTO&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(865)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_MAILTO&rdquo;的声明&nbsp;<br />
	1&gt;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(866):&nbsp;error&nbsp;C2365:&nbsp;&ldquo;URL_SCHEME_NEWS&rdquo;:&nbsp;重定义；以前的定义是&ldquo;枚举数&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c:program&nbsp;filesmicrosoft&nbsp;sdkswindowsv7.0aincludeshlwapi.h(866)&nbsp;:&nbsp;参见&ldquo;URL_SCHEME_NEWS&rdquo;的声明</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	造成这个原因是ATL和CJLIB库的兼容性问题上，从错误上看是shlwapi.h里的代码被重定义了，ATL在定义前都会判断一下是否已经定义，而CJLIB则没有判断。解决方法是把CJLIB中的shlwapi.h包含给注释掉。可以在当前项目搜索shlwapi.h，一共有两处。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibIncludeModulVer.h&nbsp;<br />
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibIncludeShellTree.h</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;把其中的&nbsp;#include&nbsp;&lt;Shlwapi.h&gt;&nbsp;改成&nbsp;//#include&nbsp;&lt;Shlwapi.h&gt;&nbsp;<br />
	重新编译后，错误一下少了很多，看起来也清爽了许多。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;1.1.7</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;gh0st3.6gh0stcj60libcj60libcjsizedockbar.cpp(89):&nbsp;error&nbsp;C2440:&ldquo;static_cast&rdquo;:&nbsp;无法从&ldquo;UINT&nbsp;(__thiscall&nbsp;CCJSizeDockBar::*&nbsp;)(CPoint)&rdquo;转换为&ldquo;LRESULT&nbsp;(__thiscall&nbsp;CWnd::*&nbsp;)(CPoint)&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从基类型到派生类型的强制转换需要&nbsp;dynamic_cast&nbsp;或&nbsp;static_cast</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这句话定位到的是ON_WM_NCHITTEST()，其实就是消息响应函数的返回值类型不匹配，这里也可以看出VS2010和VC6.0的不同。ON_WM_NCHITTEST对应的消息函数是UINTCCJSizeDockBar::OnNcHitTest(CPoint&nbsp;point)&nbsp;，把返回值类型改下就好了。有两处：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibCJ60LibCJSizeDockBar.cpp&nbsp;<br />
	UINT&nbsp;CCJSizeDockBar::OnNcHitTest(CPoint&nbsp;point)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改为：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	LRESULT&nbsp;CCJSizeDockBar::OnNcHitTest(CPoint&nbsp;point)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibIncludeCJSizeDockBar.h&nbsp;<br />
	afx_msg&nbsp;UINT&nbsp;OnNcHitTest(CPoint&nbsp;point);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改为：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	afx_msg&nbsp;LRESULT&nbsp;OnNcHitTest(CPoint&nbsp;point);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	后面还有一个一样的错误，只是所在类不一样，修改方法还是一样的</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	gh0st3.6gh0stcj60libcj60libcjcontrolbar.cpp(155):&nbsp;error&nbsp;C2440:&ldquo;static_cast&rdquo;:&nbsp;无法从&ldquo;UINT&nbsp;(__thiscall&nbsp;CCJControlBar::*&nbsp;)(CPoint)&rdquo;转换为&ldquo;LRESULT&nbsp;(__thiscall&nbsp;CWnd::*&nbsp;)(CPoint)&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从基类型到派生类型的强制转换需要&nbsp;dynamic_cast&nbsp;或&nbsp;static_cast</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这里就不再说了，请参考上面的修改。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.1.8</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	gh0st3.6gh0stcj60libcj60libcjpagerctrl.cpp(75):&nbsp;error&nbsp;C2440:&nbsp;&ldquo;static_cast&rdquo;:无法从&ldquo;BOOL&nbsp;(__thiscall&nbsp;CCJPagerCtrl::*&nbsp;)(NMPGSCROLL&nbsp;*,LRESULT&nbsp;*)&rdquo;转换为&ldquo;BOOL&nbsp;(__thiscall&nbsp;CCmdTarget::*&nbsp;)(NMHDR&nbsp;*,LRESULT&nbsp;*)&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在匹配目标类型的范围内没有具有该名称的函数&nbsp;<br />
	gh0st3.6gh0stcj60libcj60libcjpagerctrl.cpp(76):&nbsp;error&nbsp;C2440:&nbsp;&ldquo;static_cast&rdquo;:无法从&ldquo;BOOL&nbsp;(__thiscall&nbsp;CCJPagerCtrl::*&nbsp;)(NMPGCALCSIZE&nbsp;*,LRESULT&nbsp;*)&rdquo;转换为&ldquo;BOOL&nbsp;(__thiscall&nbsp;CCmdTarget::*&nbsp;)(NMHDR&nbsp;*,LRESULT&nbsp;*)&rdquo;&nbsp;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在匹配目标类型的范围内没有具有该名称的函数</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这两处的错误都是一样的，都是同一种参数类型不匹配。定位信息：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	ON_NOTIFY_REFLECT_EX(PGN_SCROLL,&nbsp;OnPagerScroll)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	ON_NOTIFY_REFLECT_EX(PGN_CALCSIZE,&nbsp;OnPagerCalcSize)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	可以看出他们所对应的函数分别是OnPagerScroll和OnPagerCalcSize。直接在上面按F12（右键&ndash;跳转到定义处）就跳转到函数定义出了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibCJ60LibCJPagerCtrl.cpp&nbsp;<br />
	BOOL&nbsp;CCJPagerCtrl::OnPagerScroll(NMPGSCROLL*&nbsp;pNMPGScroll,&nbsp;LRESULT*&nbsp;pResult)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	{</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;*pResult&nbsp;=&nbsp;0;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	return&nbsp;FALSE;&nbsp;//&nbsp;Let&nbsp;parent&nbsp;handle&nbsp;message</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	}</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	BOOL&nbsp;CCJPagerCtrl::OnPagerScroll(NMHDR*&nbsp;pNMPGScroll,&nbsp;LRESULT*&nbsp;pResult)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	{</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;*pResult&nbsp;=&nbsp;0;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	return&nbsp;FALSE;&nbsp;//&nbsp;Let&nbsp;parent&nbsp;handle&nbsp;message</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	}</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	===================================================</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	BOOL&nbsp;CCJPagerCtrl::OnPagerCalcSize(NMPGCALCSIZE*&nbsp;pNMPGCalcSize,&nbsp;LRESULT*pResult)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	{</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	switch(pNMPGCalcSize-&gt;dwFlag)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	BOOL&nbsp;CCJPagerCtrl::OnPagerCalcSize(NMHDR*&nbsp;pNMHDRPGCalcSize,&nbsp;LRESULT*&nbsp;pResult)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	{</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	NMPGCALCSIZE&nbsp;*pNMPGCalcSize&nbsp;=&nbsp;(NMPGCALCSIZE&nbsp;*)pNMHDRPGCalcSize;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	switch(pNMPGCalcSize-&gt;dwFlag)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	===================================================</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	接着修改头文件中申明的参数类型</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibIncludeCJPagerCtrl.h&nbsp;<br />
	virtual&nbsp;BOOL&nbsp;OnPagerScroll(NMPGSCROLL*&nbsp;pNMPGScroll,&nbsp;LRESULT&nbsp;*&nbsp;pResult);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	virtual&nbsp;BOOL&nbsp;OnPagerCalcSize(NMPGCALCSIZE&nbsp;*&nbsp;pNMPGCalcSize,&nbsp;LRESULT*&nbsp;pResult);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	virtual&nbsp;BOOL&nbsp;OnPagerScroll(NMHDR*&nbsp;pNMPGScroll,&nbsp;LRESULT&nbsp;*&nbsp;pResult);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	virtual&nbsp;BOOL&nbsp;OnPagerCalcSize(NMHDR*&nbsp;pNMHDRPGCalcSize,&nbsp;LRESULT*&nbsp;pResult);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1.2&nbsp;编译CJ60Lib</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	首先还是修改字符集为ANSI,不然默认为WChar_t。这步是编译Gh0st每一个项目都需要做的，以后的操作中不再提起，请注意。如果提示A函数和W函数重定义，参数冲突等，都是这个问题，改下项目属性就能解决了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	wchar_t&nbsp;*类型与USHORT&nbsp;*的转换错误</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;VC6的编译器不支持wchar_t数据类型，wchar_t实际上被定义成unsigned&nbsp;short，VC9的编译器已经支持wchar_t为内置数据类型，但是由一个编译选项控制，这个选项默认是打开的，也就是将wchar_t作为编译器的内置数据类型。但是OLECHAR和WCHAR的定义仍然是unsigned&nbsp;short，在VC6的编译环境中，两者的指针都是USHORT&nbsp;*，相互赋值和做为函数参数传递没有问题，但是如果wchar_t作为编译器的内置数据类型，那就意味着wchar_t&nbsp;*与OLECHAR&nbsp;*或WCHAR&nbsp;*是两种不同类型的指针，相互赋值就会报编译错误，下面的信息就是一个典型的错误输出：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	f:project&#8230;..shellpidl.cpp(290)&nbsp;:&nbsp;error&nbsp;C2664:&nbsp;&#39;MultiByteToWideChar&#39;&nbsp;:&nbsp;cannot&nbsp;convert&nbsp;parameter&nbsp;5&nbsp;from&nbsp;&#39;USHORT&nbsp;*&#39;&nbsp;to&nbsp;&#39;LPWSTR&#39;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Types&nbsp;pointed&nbsp;to&nbsp;are&nbsp;unrelated;&nbsp;conversion&nbsp;requires&nbsp;reinterpret_cast,&nbsp;C-style&nbsp;cast&nbsp;or&nbsp;function-style&nbsp;cast</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	解决的方法就是使用C++的reinterpret_cast操作符或使用C-style强制转换，当然也可以在项目属性设置中关闭前面提到的那个选项。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这个直接编译就能过了。用VS2010编译函数很多安全函数的警告，这个不用管他，想修改也是可以的。还有一个_WIN32_WINNT宏未定义的警告，如非必要，我就不加上去了，尽量的保持和原版的相同。要加的话，直接加在每个项目的StdAfx.h里面。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	格式：#define&nbsp;_WIN32_WINNT&nbsp;0&#215;0500</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这里的参数含义可以参看MSDN，后面有一处修改必须加，也会再次提到。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	二．编译Gh0st</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	成功编译CJ60Lib界面库之后，就可以开始编译Gh0st了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.1&nbsp;<span style="font-family: 宋体;">转换</span>Gh0st3.6<span style="font-family: 宋体;">项目</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	直接用VS2010打开Gh0st3.6gh0st.dsw&nbsp;提示转换项目，确定转换就行了。这里一共三个项目：gh0st,install,svchost。编译的时候需要先编译svchost再编译install，最后才编译gh0st。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.2&nbsp;<span style="font-family: 宋体;">编译</span>svchost</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	相同的错误修改就不再说了，参看前面的修改方法。<br />
	修改已说过的错误，再继续下面的错误修改。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.2.1</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;commonFileManager.cpp(202):&nbsp;error&nbsp;C2440:&ldquo;初始化&rdquo;:&nbsp;无法从&ldquo;const&nbsp;char&nbsp;*&rdquo;转换为&ldquo;char&nbsp;*&rdquo;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;转换丢失限定符</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	char&nbsp;*lpExt&nbsp;=&nbsp;strrchr(lpFile,&nbsp;&lsquo;.&rsquo;);&nbsp;<br />
	修改为：<br />
	const&nbsp;char&nbsp;*lpExt&nbsp;=&nbsp;strrchr(lpFile,&nbsp;&lsquo;.&rsquo;);&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;e:programmingvs2010gh0st3.6serversvchostcommonloop.h(160):&nbsp;error&nbsp;C2440:&ldquo;=&rdquo;:&nbsp;无法从&ldquo;const&nbsp;char&nbsp;*&rdquo;转换为&ldquo;char&nbsp;*&rdquo;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;转换丢失限定符</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	char&nbsp;*lpFileName&nbsp;=&nbsp;NULL;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	lpFileName&nbsp;=&nbsp;strrchr(lpURL,&nbsp;&lsquo;/&rsquo;)&nbsp;+&nbsp;1;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改为:</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	Const&nbsp;char&nbsp;*lpFileName&nbsp;=&nbsp;NULL;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	lpFileName&nbsp;=&nbsp;strrchr(lpURL,&nbsp;&lsquo;/&rsquo;)&nbsp;+&nbsp;1;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.2.2</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;commonScreenSpy.cpp(355):&nbsp;error&nbsp;C2062:&nbsp;意外的类型&ldquo;int&rdquo;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	for&nbsp;(inti&nbsp;=&nbsp;0,&nbsp;intnToJump&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;nHeight;&nbsp;i&nbsp;+=&nbsp;nToJump)&nbsp;<br />
	修改为：<br />
	int&nbsp;i=0;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	for&nbsp;(i&nbsp;=&nbsp;0,&nbsp;nToJump&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;nHeight;&nbsp;i&nbsp;+=&nbsp;nToJump)&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.2.3</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;commonVideoManager.cpp(123):&nbsp;error&nbsp;C4430:&nbsp;缺少类型说明符&nbsp;&ndash;&nbsp;假定为&nbsp;int。注意:&nbsp;C++&nbsp;不支持默认&nbsp;int</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	定位在：<br />
	static&nbsp;dwLastScreen&nbsp;=&nbsp;GetTickCount();&nbsp;<br />
	这个错误前面已经提到过，是添加现式定义类型int。这里添加现式类型为&nbsp;DWORD&nbsp;比较好，因为后面的函数GetTickCount返回值是DWORD类型。在这里修改如下：<br />
	static&nbsp;DWORD&nbsp;dwLastScreen&nbsp;=&nbsp;GetTickCount();&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.2.4</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;commonScreenManager.cpp(7):&nbsp;fatal&nbsp;error&nbsp;C1083:&nbsp;无法打开包括文件:&ldquo;winable.h&rdquo;:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	Winable头文件从VS2008里面就已经不存在了，MSDN里描述如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	从&nbsp;Visual&nbsp;Studio&nbsp;早期版本升级项目时，您可能必须修改&nbsp;WINVER&nbsp;和&nbsp;_WIN32_WINNT&nbsp;宏，以便它们大于或等于&nbsp;0&times;0500。<br />
	已移除&nbsp;Windows&nbsp;API&nbsp;头文件&nbsp;Winable.h。而改为包括&nbsp;Winuser.h。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	因为Winuser默认已经包含进来了，所以直接注释这句话就行了。但是如果直接这样，引用Winable中的函数就会出现未定义错误。所以这里除了需要注释这个头文件包含，还需要注释这个文件中的_WIN32_WINNT宏定义，或者修改宏定义大于等于500。我这里直接注释掉了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	#define_WIN32_WINNT&nbsp;0&times;0400&nbsp;<br />
	#include&quot;ScreenManager.h&quot;<br />
	#include&quot;until.h&quot;<br />
	#include&lt;winable.h&gt;//&nbsp;BlockInput&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改为：&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	//#define&nbsp;_WIN32_WINNT&nbsp;0&times;0400<br />
	#include&quot;ScreenManager.h&quot;<br />
	#include&quot;until.h&quot;<br />
	//#include&nbsp;&lt;winable.h&gt;&nbsp;//&nbsp;BlockInput&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.3&nbsp;<span style="font-family: 宋体;">编译</span>install</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这个能直接编译通过，就算不修改默认字符集，但还是建议和前面一样，修改下默然字符。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.4&nbsp;<span style="font-family: 宋体;">编译</span>gh0st</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	一开始编译就会有个错误提示而终止，如果不修改没法正常编译。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;C:Program&nbsp;FilesMicrosoft&nbsp;Visual&nbsp;Studio&nbsp;10.0VCatlmfcincludeafx.h(24):&nbsp;fatal&nbsp;error&nbsp;C1189:&nbsp;#error&nbsp;:&nbsp;Building&nbsp;MFC&nbsp;application&nbsp;with&nbsp;/MD[d]&nbsp;(CRT&nbsp;dll&nbsp;version)&nbsp;requires&nbsp;MFC&nbsp;shared&nbsp;dll&nbsp;version.&nbsp;Please&nbsp;#define&nbsp;_AFXDLL&nbsp;or&nbsp;do&nbsp;not&nbsp;use&nbsp;/MD[d]</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;这个还是需要修改属性页。需要把代码生成里的运行时库改成/MT。如图：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818493d2Vf.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改之后重新编译就能看到很多错误了。在继续下面的错误修改之前，先把前面讲到的错误类型给修改好。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.4.1</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;controlBtnST.cpp(4):&nbsp;fatal&nbsp;error&nbsp;C1083:&nbsp;无法打开包括文件:&ldquo;stdafx.h&rdquo;:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	提示找不到stdafx.h，其实这个文件是存在的。在属性里添加&ldquo;./&rdquo;的包含目录就能解决了。<br />
	在属性页的C/C++&mdash;General&mdash;Additional&nbsp;Include&nbsp;Directories&nbsp;里添加。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	原来的是：<br />
	CJ60lib/Include;../common;%(AdditionalIncludeDirectories)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改后为：<br />
	./;CJ60lib/Include;../common;%(AdditionalIncludeDirectories)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	如图：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_132081851477PX.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.4.2</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(27):&nbsp;error&nbsp;C2011:&ldquo;BGTYPE&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(14)&nbsp;:&nbsp;参见&ldquo;BGTYPE&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(33):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;IMAGELAYOUT&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(25)&nbsp;:&nbsp;参见&ldquo;IMAGELAYOUT&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(38):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;BORDERTYPE&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(35)&nbsp;:&nbsp;参见&ldquo;BORDERTYPE&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(44):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;FILLTYPE&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(46)&nbsp;:&nbsp;参见&ldquo;FILLTYPE&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(52):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;SIZINGTYPE&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(59)&nbsp;:&nbsp;参见&ldquo;SIZINGTYPE&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(58):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;HALIGN&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(70)&nbsp;:&nbsp;参见&ldquo;HALIGN&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(64):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;CONTENTALIGNMENT&rdquo;:&ldquo;enum&rdquo;类型重定义<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C:Program&nbsp;FilesMicrosoft&nbsp;SDKsWindowsv7.0Aincludevssym32.h(81)&nbsp;:&nbsp;参见&ldquo;CONTENTALIGNMENT&rdquo;的声明<br />
	1&gt;e:programmingvs2010gh0st3.6gh0stTmSchema.h(70):&nbsp;error&nbsp;C2011:&nbsp;&ldquo;VALIGN&rdquo;:&ldquo;enum&rdquo;类型重定义</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	又是一堆的类型重定义错误，这次需要现式的指出Windows版本才能解决这个问题。打开stdafx.h，在其中添加&nbsp;#define&nbsp;_WIN32_WINNT&nbsp;0&times;0500&nbsp;。下面是我的操作，实际放置的位置可以自己调整。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stStdAfx.h</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	#define&nbsp;VC_EXTRALEAN//&nbsp;Exclude&nbsp;rarely-used&nbsp;stuff&nbsp;from&nbsp;Windows&nbsp;headers<br />
	#include&lt;afxwin.h&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;MFC&nbsp;core&nbsp;and&nbsp;standard&nbsp;components<br />
	#include&lt;afxext.h&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;MFC&nbsp;extensions<br />
	#include&lt;afxcview.h&gt;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	#define&nbsp;VC_EXTRALEAN//&nbsp;Exclude&nbsp;rarely-used&nbsp;stuff&nbsp;from&nbsp;Windows&nbsp;headers<br />
	#define&nbsp;_WIN32_WINNT&nbsp;0&times;0500&nbsp;<br />
	#include&lt;afxwin.h&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;MFC&nbsp;core&nbsp;and&nbsp;standard&nbsp;components<br />
	#include&lt;afxext.h&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;MFC&nbsp;extensions<br />
	#include&lt;afxcview.h&gt;&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这里就说下参数的含义，0&times;0500是指Windows&nbsp;2000，这个宏定义说明这个程序只是要在Windows&nbsp;2000&nbsp;及以上的操作系统上才能正常运行。0&times;0501&nbsp;Windows&nbsp;XP、0&times;0502&nbsp;Windows&nbsp;Server&nbsp;2003、&nbsp;0&times;0600&nbsp;Windows&nbsp;Vista、0&times;0601&nbsp;Windows&nbsp;7。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.4.3</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;TrueColorToolBar.cpp(42):&nbsp;error&nbsp;C2440:&ldquo;static_cast&rdquo;:&nbsp;无法从&ldquo;void&nbsp;(__thiscall&nbsp;CTrueColorToolBar::*&nbsp;)(NMTOOLBARA&nbsp;*,LRESULT&nbsp;*)&rdquo;转换为&ldquo;void&nbsp;(__thiscall&nbsp;CCmdTarget::*&nbsp;)(NMHDR&nbsp;*,LRESULT&nbsp;*)&rdquo;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在匹配目标类型的范围内没有具有该名称的函数</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	这个和1.1.8是一样的。这里再说下。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	定位到：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	ON_NOTIFY_REFLECT(TBN_DROPDOWN,&nbsp;OnToolbarDropDown)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	可以在OnToolbarDropDown上点右键跳转到定义（F12），跳转到申明（Ctrl+Alt+F12）</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stTrueColorToolBar.cpp</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	Void&nbsp;CTrueColorToolBar::OnToolbarDropDown(NMTOOLBAR*&nbsp;pnmtb,&nbsp;LRESULT&nbsp;*plr)&nbsp;<br />
	{&nbsp;<br />
	for&nbsp;(inti&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;m_lstDropDownButton.GetSize();&nbsp;i++)&nbsp;{&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	Void&nbsp;CTrueColorToolBar::OnToolbarDropDown(NMHDR*&nbsp;NMHDRpnmtb,&nbsp;LRESULT&nbsp;*plr)&nbsp;<br />
	{&nbsp;<br />
	NMTOOLBARA&nbsp;*pnmtb&nbsp;=&nbsp;(NMTOOLBARA&nbsp;*)NMHDRpnmtb;&nbsp;<br />
	int&nbsp;i=0;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	for&nbsp;(i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;m_lstDropDownButton.GetSize();&nbsp;i++)&nbsp;{&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stTrueColorToolBar.h</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	afx_msg&nbsp;void&nbsp;OnToolbarDropDown(NMTOOLBAR*&nbsp;pnmh,&nbsp;LRESULT*&nbsp;plRes);</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	afx_msg&nbsp;void&nbsp;OnToolbarDropDown(NMHDR*&nbsp;NMHDRpnmtb,&nbsp;LRESULT*&nbsp;plRes);&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	2.5</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gh0st<span style="font-family: 宋体;">就只有这些错误了。下一节将讲解连接错误。</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	三．解决连接错误</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;到现在为止，所以代码已经没有任何错误了，但在Gh0st还是编译不成功，而错误全部是在连接错误上。下面来解决掉这些链接错误。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	3.1&nbsp;CJ60StaticLib<span style="font-family: 宋体;">链接库错误</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	首先我们看到的是CJ60StaticLib的链接错误</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;CJ60StaticLib.lib(CJListView.obj)&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;无法解析的外部符号&nbsp;&quot;protected:&nbsp;static&nbsp;struct&nbsp;AFX_MSGMAP&nbsp;const&nbsp;CListView::messageMap&quot;&nbsp;(<a href="mailto:?messageMap@CListView@@1UAFX_MSGMAP@@B" style="color: rgb(255, 153, 0); text-decoration: initial;">?messageMap@CListView@@1UAFX_MSGMAP@@B</a>)&nbsp;<br />
	1&gt;CJ60StaticLib.lib(CJListView.obj)&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;无法解析的外部符号&nbsp;&quot;public:&nbsp;__thiscall&nbsp;CString::~CString(void)&quot;&nbsp;(<a href="mailto:??1CString@@QAE@XZ" style="color: rgb(255, 153, 0); text-decoration: initial;">??1CString@@QAE@XZ</a>)&nbsp;<br />
	1&gt;CJ60StaticLib.lib(CJListCtrl.obj)&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;无法解析的外部符号&nbsp;&quot;public:&nbsp;__thiscall&nbsp;CString::~CString(void)&quot;&nbsp;(<a href="mailto:??1CString@@QAE@XZ" style="color: rgb(255, 153, 0); text-decoration: initial;">??1CString@@QAE@XZ</a>)&nbsp;<br />
	1&gt;CJ60StaticLib.lib(CJListView.obj)&nbsp;:&nbsp;error&nbsp;LNK2019:&nbsp;无法解析的外部符号&nbsp;&quot;public:&nbsp;void&nbsp;__thiscall&nbsp;CString::Empty(void)&quot;&nbsp;(?Empty@CString@@QAEXXZ)，该符号在函数&nbsp;&quot;public:&nbsp;__thiscall&nbsp;CCJListView::CCJListView(void)&quot;&nbsp;(??0CCJListView@@QAE@XZ)&nbsp;中被引用<br />
	1&gt;CJ60StaticLib.lib(CJListCtrl.obj)&nbsp;:&nbsp;error&nbsp;LNK2001:&nbsp;无法解析的外部符号&nbsp;&quot;public:&nbsp;void&nbsp;__thiscall&nbsp;CString::Empty(void)&quot;&nbsp;(?Empty@CString@@QAEXXZ)</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	从错误上看，gh0st链接的是CJ60StaticLib.lib库，但是前面我们编译的CJ60StaticLib产生的库却是CJ60StaticLibd.lib，是CJ60StaticLib的Debug版本的库，这里链接的却是Release版的库。不信可以看下CJ60StaticLib的生成目录：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibLib</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818590PMn7.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	看些日期也就知道，我们前面编译的文件名后面都多了d。从新打开CJ60StaticLib项目。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibCJ60LibCJ60Lib.sln</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	可以直接在界面上的修改成Release，或在项目属性里点配置成Release。如下图：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_13208186801DHH.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	或者：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818760zp59.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	修改后如果直接这样编译，会出现类似下面的错误：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;ShellPidl.cpp(220):&nbsp;error&nbsp;C2664:&nbsp;&ldquo;MultiByteToWideChar&rdquo;:&nbsp;不能将参数&nbsp;5&nbsp;从&ldquo;USHORT&nbsp;*&rdquo;转换为&ldquo;LPWSTR&rdquo;<br />
	1&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;与指向的类型无关；转换要求&nbsp;reinterpret_cast、C&nbsp;样式转换或函数样式转换</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	一看就知道是默认字符集问题，前面只在Debug模式下修改了默认不是WChar_t类型，而切换到Release模式也要记得修改。重新修改，编译CJ60StaticLib和CJ60Lib。再来看下生成目录。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	E:ProgrammingVS2010Gh0st3.6gh0stCJ60LibLib</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	3.2&nbsp;gh0st<span style="font-family: 宋体;">链接错误</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	&nbsp;</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	现在再来编译一次gh0st，链接错误是不是没有出现在CJ60StaticLib上了</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	1&gt;C:Program&nbsp;FilesMSBuildMicrosoft.Cppv4.0Microsoft.CppBuild.targets(990,5):&nbsp;warning&nbsp;MSB8012:&nbsp;TargetPath(E:ProgrammingVS2010Gh0st3.6gh0st.Releasegh0st.exe)&nbsp;does&nbsp;not&nbsp;match&nbsp;the&nbsp;Linker&rsquo;s&nbsp;OutputFile&nbsp;property&nbsp;value&nbsp;(E:ProgrammingVS2010Gh0st3.6Bingh0st.exe).&nbsp;This&nbsp;may&nbsp;cause&nbsp;your&nbsp;project&nbsp;to&nbsp;build&nbsp;incorrectly.&nbsp;To&nbsp;correct&nbsp;this,&nbsp;please&nbsp;make&nbsp;sure&nbsp;that&nbsp;$(OutDir),&nbsp;$(TargetName)&nbsp;and&nbsp;$(TargetExt)&nbsp;property&nbsp;values&nbsp;match&nbsp;the&nbsp;value&nbsp;specified&nbsp;in&nbsp;%(Link.OutputFile).&nbsp;<br />
	1&gt;nafxcw.lib(afxmem.obj)&nbsp;:&nbsp;error&nbsp;LNK2005:&nbsp;&quot;void&nbsp;*&nbsp;__cdecl&nbsp;operator&nbsp;new(unsigned&nbsp;int)&quot;&nbsp;(??2@YAPAXI@Z)&nbsp;已经在&nbsp;LIBCMT.lib(new.obj)&nbsp;中定义<br />
	1&gt;nafxcw.lib(afxmem.obj)&nbsp;:&nbsp;error&nbsp;LNK2005:&nbsp;&quot;void&nbsp;__cdecl&nbsp;operator&nbsp;delete(void&nbsp;*)&quot;&nbsp;(??3@YAXPAX@Z)&nbsp;已经在LIBCMT.lib(delete.obj)&nbsp;中定义<br />
	1&gt;nafxcw.lib(afxmem.obj)&nbsp;:&nbsp;error&nbsp;LNK2005:&nbsp;&quot;void&nbsp;*&nbsp;__cdecl&nbsp;operator&nbsp;new[](unsigned&nbsp;int)&quot;&nbsp;(??_U@YAPAXI@Z)已经在&nbsp;LIBCMT.lib(new2.obj)&nbsp;中定义<br />
	1&gt;nafxcw.lib(afxmem.obj)&nbsp;:&nbsp;error&nbsp;LNK2005:&nbsp;&quot;void&nbsp;__cdecl&nbsp;operator&nbsp;delete[](void&nbsp;*)&quot;&nbsp;(??_V@YAXPAX@Z)&nbsp;已经在&nbsp;LIBCMT.lib(delete2.obj)&nbsp;中定义<br />
	1&gt;../Bin/gh0st.exe&nbsp;:&nbsp;fatal&nbsp;error&nbsp;LNK1169:&nbsp;找到一个或多个多重定义的符号</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	看错误提示，都是nafxcw.lib已经在LIBCMT.lib里定义，其实这就是VS链接库顺序的问题了，需要修正这些链接库的顺序。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	打开gh0st项目的属性页面，在连接选项卡里选择Input。在忽略默认链接库（Ignore&nbsp;Specific&nbsp;Default&nbsp;Libraries）里可以看到原来的gh0st已经忽略了msvcrt.lib，这个对我们没有任何影响，去掉这个忽略。直接修改为：nafxcw.lib;LIBCMT.lib。然后在依赖关系（Additional&nbsp;Dependencies）里指定这两个库的链接顺序，在最前面添加：nafxcw.lib;LIBCMT.lib。这两个一定要在最前面。并且顺便不能乱。至于怎么看顺序，其实很简单，他不是说nafxcw.lib已经在LIBCMT.lib里定义了吗，那就是说在连接nafxcw.lib之前已经连接了LIBCMT.lib。修改如图：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_13208187898ZG1.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	四．结束</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	最后的运行效果如下：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	<img alt="" src="http://hi.csdn.net/attachment/201111/9/0_1320818850dD96.gif" style="border: none;" /></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	如果编译之后生成的服务端，直接放到没有装VS2010的扩展库的系统下是不能运行的，只需要把提示缺少的文件从VS2010的安装目录拷贝到系统的system32下就能运行并上线了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	也可以把gh0st里的三个项目都改成Release版，这样就可以直接在其他系统中运行了。这里我就不讲解了，后续如需修改就看各自的了。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	4.1&nbsp;<span style="font-family: 宋体;">补充</span></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
	在VM中的Server2003上测试时，发现这次的修改已经是Release版了，可以直接运行，不需要VS2010的扩展库支持了。以前编译的时候改动了很多地方，编译的是Debug版的，而且有警告弹窗。这次为了写本文档，尽量的保持了和原版本的一致。竟然没有以前的错误，也算是比以前的完美点了吧。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=64</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
