VC typedef struct_WNDCLASS 问题

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:19:19
typedef struct_WNDCLASS {
......
......
} WNDCLASS;
其中struct_WNDCLASS为什么多一个下划线啊!!不是struct+空格+WNDCLASS
的么?或者是
typedef struct{
......
......
} WNDCLASS;
为什么会这样的啊,我看了C语言方面的书好像都没有这样的,还有VC6.0中
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrewInstance,LPSTR IpCmdLine,int nCmdShow)
为什么会多了一个WINAPI啊,不是"数据类型 +函数名"的么?不懂指教下!!

至于这个问题 typedef struct_WNDCLASS 就是命名规则的问题,你把它写成什么名字都可以。他写成那样也就是为了好理解。
WINAPI 只是函数的一种调用规则。
可以参考下面:
#define WINAPI FAR PASCAL
// PASCAL is used for static member functions
#ifndef PASCAL
#define PASCAL __stdcall
#endif