注册 登录
编程论坛 VC++/MFC

win32编程序定义父窗口类和子窗口类,出现问题,求解呀!!

musicjourney 发布于 2012-02-14 10:42, 867 次点击
用win32编写程序,想创建子窗口和父窗口,首先设计个窗口类,我用WNDCLASS定义两个窗口类wndclass和childwndclass,为什么编译的时候老是报错,
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(201) : error C2275: 'WNDCLASS' : illegal use of this type as an expression
        c:\program files\microsoft visual studio\vc98\include\winuser.h(1214) : see declaration of 'WNDCLASS'
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(201) : error C2146: syntax error : missing ';' before identifier 'childwndclass'
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(201) : error C2065: 'childwndclass' : undeclared identifier
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(202) : error C2224: left of '.style' must have struct/union type
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(203) : error C2224: left of '.lpfnWndProc' must have struct/union type
d:\pci9846h\sdk98x6dbfposttrg\98x6ptrg.c(204) : error C2224: left of '.cbClsExtra' must have struct/union type
我看《windows程序设计》书上第七章鼠标里面的checker3程序,它是只用WNDCLASS定义一个wndclass表示父窗口类和子窗口类。
不知道定义两个窗口类名为什么报错?
1 回复
#2
iyiwei_yang2012-02-16 10:36
一般情况下,不要这么浪费,C++既然给出了这么一种思想,就按他的来,具体的意思我表达不出来,就是一个类,大家都可以用。。再比如一个按钮类,可以被多个按钮调用,然后实现具体不同的
1