我来我网
https://5come5.cn
 
您尚未 登录  注册 | 菠菜 | 软件站 | 音乐站 | 邮箱1 | 邮箱2 | 风格选择 | 更多 » 
 

本页主题: [求助]求高人找出下面程序中的问题。 显示签名 | 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

wildwind



性别: 保密 状态: 该用户目前不在线
等级: 栋梁之材
发贴: 785
威望: 1
浮云: 1134
在线等级:
注册时间: 2004-04-08
最后登陆: 2007-06-27

5come5帮你背单词 [ indeed /in'di:d/ ad. 实际上,确实 ]


[求助]求高人找出下面程序中的问题。

在WinApp.h的HINSTANCE GetAppHandle();前的分号去掉就会出错,
哪个达人来解释一下。
顶端 Posted: 2006-11-06 09:09 | [楼 主]
wildwind



性别: 保密 状态: 该用户目前不在线
等级: 栋梁之材
发贴: 785
威望: 1
浮云: 1134
在线等级:
注册时间: 2004-04-08
最后登陆: 2007-06-27

5come5帮你背单词 [ handbag /'hændbæg/ n. 女用手提包,旅行用手提包 ]


如下:
#ifndef __WinApp_H__
#define __WinAPP_H__

#include "AppEntry.h"

//获得主程序句柄
;HINSTANCE GetAppHandle();//就是这里了。
//获得主窗口句柄
HWND GetMainWnd();

#endif //__WinAPP_H__
顶端 Posted: 2006-11-06 10:10 | [1 楼]
wildwind



性别: 保密 状态: 该用户目前不在线
等级: 栋梁之材
发贴: 785
威望: 1
浮云: 1134
在线等级:
注册时间: 2004-04-08
最后登陆: 2007-06-27

5come5帮你背单词 [ collaborate /kə'læbəreit/ vi. 合作,协作 ]


--------------------Configuration: tank - Win32 Debug--------------------
Compiling...
WinApp.cpp
d:\bc++\study\tank\winapp.h(10) : error C2146: syntax error : missing ';' before identifier 'GetAppHandle'
d:\bc++\study\tank\winapp.h(10) : error C2259: 'IAppEntry' : cannot instantiate abstract class due to following members:
    d:\bc++\study\tank\appentry.h(12) : see declaration of 'IAppEntry'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'bool __thiscall IAppEntry::Initialize(struct HINSTANCE__ *,struct HWND__ *)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(14) : see declaration of 'Initialize'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Terminal(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(16) : see declaration of 'Terminal'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Process(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(18) : see declaration of 'Process'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Render(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(20) : see declaration of 'Render'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'long __thiscall IAppEntry::WndProc(unsigned int,unsigned int,long)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(22) : see declaration of 'WndProc'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const char *__thiscall IAppEntry::WindowClassName(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(24) : see declaration of 'WindowClassName'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowWidth(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(26) : see declaration of 'WindowWidth'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowHeight(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(28) : see declaration of 'WindowHeight'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HINSTANCE__ *__thiscall IAppEntry::GetInstance(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(30) : see declaration of 'GetInstance'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HWND__ *__thiscall IAppEntry::GetWnd(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(32) : see declaration of 'GetWnd'
d:\bc++\study\tank\winapp.h(10) : error C2377: 'HINSTANCE' : redefinition; typedef cannot be overloaded with any other symbol
    c:\program files\microsoft visual studio\vc98\include\windef.h(252) : see declaration of 'HINSTANCE'
d:\bc++\study\tank\winapp.h(10) : error C2259: 'IAppEntry' : cannot instantiate abstract class due to following members:
    d:\bc++\study\tank\appentry.h(12) : see declaration of 'IAppEntry'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'bool __thiscall IAppEntry::Initialize(struct HINSTANCE__ *,struct HWND__ *)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(14) : see declaration of 'Initialize'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Terminal(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(16) : see declaration of 'Terminal'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Process(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(18) : see declaration of 'Process'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Render(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(20) : see declaration of 'Render'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'long __thiscall IAppEntry::WndProc(unsigned int,unsigned int,long)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(22) : see declaration of 'WndProc'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const char *__thiscall IAppEntry::WindowClassName(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(24) : see declaration of 'WindowClassName'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowWidth(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(26) : see declaration of 'WindowWidth'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowHeight(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(28) : see declaration of 'WindowHeight'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HINSTANCE__ *__thiscall IAppEntry::GetInstance(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(30) : see declaration of 'GetInstance'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HWND__ *__thiscall IAppEntry::GetWnd(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(32) : see declaration of 'GetWnd'
d:\bc++\study\tank\winapp.h(10) : fatal error C1004: unexpected end of file found
AppGame.cpp
d:\bc++\study\tank\winapp.h(10) : error C2146: syntax error : missing ';' before identifier 'GetAppHandle'
d:\bc++\study\tank\winapp.h(10) : error C2259: 'IAppEntry' : cannot instantiate abstract class due to following members:
    d:\bc++\study\tank\appentry.h(12) : see declaration of 'IAppEntry'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'bool __thiscall IAppEntry::Initialize(struct HINSTANCE__ *,struct HWND__ *)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(14) : see declaration of 'Initialize'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Terminal(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(16) : see declaration of 'Terminal'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Process(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(18) : see declaration of 'Process'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Render(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(20) : see declaration of 'Render'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'long __thiscall IAppEntry::WndProc(unsigned int,unsigned int,long)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(22) : see declaration of 'WndProc'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const char *__thiscall IAppEntry::WindowClassName(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(24) : see declaration of 'WindowClassName'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowWidth(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(26) : see declaration of 'WindowWidth'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowHeight(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(28) : see declaration of 'WindowHeight'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HINSTANCE__ *__thiscall IAppEntry::GetInstance(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(30) : see declaration of 'GetInstance'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HWND__ *__thiscall IAppEntry::GetWnd(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(32) : see declaration of 'GetWnd'
d:\bc++\study\tank\winapp.h(10) : error C2377: 'HINSTANCE' : redefinition; typedef cannot be overloaded with any other symbol
    c:\program files\microsoft visual studio\vc98\include\windef.h(252) : see declaration of 'HINSTANCE'
d:\bc++\study\tank\winapp.h(10) : error C2259: 'IAppEntry' : cannot instantiate abstract class due to following members:
    d:\bc++\study\tank\appentry.h(12) : see declaration of 'IAppEntry'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'bool __thiscall IAppEntry::Initialize(struct HINSTANCE__ *,struct HWND__ *)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(14) : see declaration of 'Initialize'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Terminal(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(16) : see declaration of 'Terminal'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Process(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(18) : see declaration of 'Process'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'void __thiscall IAppEntry::Render(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(20) : see declaration of 'Render'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'long __thiscall IAppEntry::WndProc(unsigned int,unsigned int,long)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(22) : see declaration of 'WndProc'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const char *__thiscall IAppEntry::WindowClassName(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(24) : see declaration of 'WindowClassName'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowWidth(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(26) : see declaration of 'WindowWidth'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'const int __thiscall IAppEntry::WindowHeight(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(28) : see declaration of 'WindowHeight'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HINSTANCE__ *__thiscall IAppEntry::GetInstance(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(30) : see declaration of 'GetInstance'
d:\bc++\study\tank\winapp.h(10) : warning C4259: 'struct HWND__ *__thiscall IAppEntry::GetWnd(void)' : pure virtual function was not defined
    d:\bc++\study\tank\appentry.h(32) : see declaration of 'GetWnd'
d:\bc++\study\tank\winapp.h(10) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

tank.exe - 10 error(s), 40 warning(s)

发了。
顶端 Posted: 2006-11-06 18:55 | [2 楼]
wildwind



性别: 保密 状态: 该用户目前不在线
等级: 栋梁之材
发贴: 785
威望: 1
浮云: 1134
在线等级:
注册时间: 2004-04-08
最后登陆: 2007-06-27

5come5帮你背单词 [ rhyme /raim/ n. 押韵,韵脚;v. 押韵 ]


找到问题的关键了,KAO,原来在定义类时}号后要加;
顶端 Posted: 2006-11-06 19:21 | [3 楼]
我来我网·5come5 Forum » 程序员之家

Total 0.009458(s) query 6, Time now is:11-24 02:36, Gzip enabled
Powered by PHPWind v5.3, Localized by 5come5 Tech Team, 黔ICP备16009856号