首页
社区
课程
招聘
[旧帖] [求助]这样定义宏对不? 0.00雪花
发表于: 2008-12-4 17:17 3669

[旧帖] [求助]这样定义宏对不? 0.00雪花

xhK 活跃值
3
2008-12-4 17:17
3669
在看Vc++的include文件夹里面的头文件,其中wininet.h在第42行,有这样一句
#define BOOLAPI INTERNETAPI BOOL WINAPI
这句对不对,中间有3个空格,宏不是有空格隔开的吗
高手解答下,谢啦!

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 11705
活跃值: (970)
能力值: ( LV12,RANK:779 )
在线值:
发帖
回帖
粉丝
2
"BOOLAPI" 将被替换为 "INTERNETAPI BOOL WINAPI"
2008-12-4 17:48
0
雪    币: 159
活跃值: (38)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
3
谢谢了
我写一个程序
#include <wininet.h>

void main()
{}

编译不通过,提示:
c:\program files\microsoft visual studio\vc98\include\wininet.h(48) : error C2146: syntax error : missing ';' before identifier 'HINTERNET'
c:\program files\microsoft visual studio\vc98\include\wininet.h(48) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

#if !defined(_WININET_)
#define _WININET_

/*
* Set up Structure Packing to be 4 bytes
* for all wininet structures
*/

#pragma pack(push, wininet, 4)

#if defined(__cplusplus)
extern "C" {
#endif

#if !defined(_WINX32_)
#define INTERNETAPI DECLSPEC_IMPORT
#define URLCACHEAPI DECLSPEC_IMPORT
#else
#define INTERNETAPI
#define URLCACHEAPI
#endif

#define BOOLAPI INTERNETAPI BOOL WINAPI

//
// internet types
//

typedef LPVOID HINTERNET;   这里是48行
typedef HINTERNET * LPHINTERNET;

typedef WORD INTERNET_PORT;
typedef INTERNET_PORT * LPINTERNET_PORT;

//
// Internet APIs
//

//
// manifests
//

#define INTERNET_INVALID_PORT_NUMBER    0           // use the protocol-specific default

#define INTERNET_DEFAULT_FTP_PORT       21          // default for FTP servers
#define INTERNET_DEFAULT_GOPHER_PORT    70          //    "     "  gopher "
#define INTERNET_DEFAULT_HTTP_PORT      80          //    "     "  HTTP   "
#define INTERNET_DEFAULT_HTTPS_PORT     443         //    "     "  HTTPS  "
#define INTERNET_DEFAULT_SOCKS_PORT     1080  
高手看下,是怎么回事,我想这个头文件是微软程序员写的,怎么会错呢,那是我写的有问题吧,究竟是错在哪里了呢
2008-12-4 17:57
0
雪    币: 462
活跃值: (53)
能力值: ( LV9,RANK:460 )
在线值:
发帖
回帖
粉丝
4
由于你未包含windows.h文件,所以LPVOID这个符号未定义,因此typedef LPVOID HINTERNET;出错。
2008-12-4 18:10
0
雪    币: 159
活跃值: (38)
能力值: ( LV9,RANK:140 )
在线值:
发帖
回帖
粉丝
5
谢谢了大哥,果然是没有包含Windows.h文件的原因
2008-12-4 19:46
0
游客
登录 | 注册 方可回帖
返回
//