VS2010编译Gh0st3.6(二)续

来源:互联网 发布:医疗网络咨询技巧 编辑:程序博客网 时间:2024/06/06 17:12


2.4.2

1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(27): error C2011: “BGTYPE”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(14) : 参见“BGTYPE”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(33): error C2011: “IMAGELAYOUT”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(25) : 参见“IMAGELAYOUT”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(38): error C2011: “BORDERTYPE”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(35) : 参见“BORDERTYPE”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(44): error C2011: “FILLTYPE”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(46) : 参见“FILLTYPE”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(52): error C2011: “SIZINGTYPE”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(59) : 参见“SIZINGTYPE”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(58): error C2011: “HALIGN”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(70) : 参见“HALIGN”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(64): error C2011: “CONTENTALIGNMENT”:“enum”类型重定义 
1>          C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\vssym32.h(81) : 参见“CONTENTALIGNMENT”的声明 
1>e:\programming\vs2010\gh0st3.6\gh0st\TmSchema.h(70): error C2011: “VALIGN”:“enum”类型重定义

又是一堆的类型重定义错误,这次需要现式的指出Windows版本才能解决这个问题。打开stdafx.h,在其中添加 #define _WIN32_WINNT 0×0500 。下面是我的操作,实际放置的位置可以自己调整。

E:\Programming\VS2010\Gh0st3.6\gh0st\StdAfx.h

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 
#include <afxwin.h>         // MFC core and standard components 
#include <afxext.h>         // MFC extensions 
#include <afxcview.h>

修改如下:

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 
#define _WIN32_WINNT 0×0500 
#include <afxwin.h>         // MFC core and standard components 
#include <afxext.h>         // MFC extensions 
#include <afxcview.h>

这里就说下参数的含义,0×0500是指Windows 2000,这个宏定义说明这个程序只是要在Windows 2000 及以上的操作系统上才能正常运行。0×0501 Windows XP、0×0502 Windows Server 2003、 0×0600 Windows Vista、0×0601 Windows 7。

2.4.3

1>TrueColorToolBar.cpp(42): error C2440: “static_cast”: 无法从“void (__thiscall CTrueColorToolBar::* )(NMTOOLBARA *,LRESULT *)”转换为“void (__thiscall CCmdTarget::* )(NMHDR *,LRESULT *)” 
1>          在匹配目标类型的范围内没有具有该名称的函数

这个和1.1.8是一样的。这里再说下。

定位到:

ON_NOTIFY_REFLECT(TBN_DROPDOWN, OnToolbarDropDown)

可以在OnToolbarDropDown上点右键跳转到定义(F12),跳转到申明(Ctrl+Alt+F12)

E:\Programming\VS2010\Gh0st3.6\gh0st\TrueColorToolBar.cpp

void CTrueColorToolBar::OnToolbarDropDown(NMTOOLBAR* pnmtb, LRESULT *plr) 

for (int i = 0; i < m_lstDropDownButton.GetSize(); i++) {

修改如下:

void CTrueColorToolBar::OnToolbarDropDown(NMHDR* NMHDRpnmtb, LRESULT *plr) 

NMTOOLBARA *pnmtb = (NMTOOLBARA *)NMHDRpnmtb; 
for (int i = 0; i < m_lstDropDownButton.GetSize(); i++) {

E:\Programming\VS2010\Gh0st3.6\gh0st\TrueColorToolBar.h

afx_msg void OnToolbarDropDown(NMTOOLBAR* pnmh, LRESULT* plRes);

修改如下:

afx_msg void OnToolbarDropDown(NMHDR* NMHDRpnmtb, LRESULT* plRes);

2.5

      Gh0st就只有这些错误了。下一节将讲解连接错误。

原创粉丝点击