百思不得其解
c语言吧
全部回复
仅看楼主
level 6
VC_yjt 楼主
按照王艳平的《windows程序设计》的第一个程序,想试试效果
#include "stdafx.h"
#include<windows.h>
int main(int argc, char* argv[])
{
int nSelect=::MessageBox(Null,"Hello Windows 7","Greetings",MB_OKCANCEL);
if(nSelect==IDOK)
printf("用户选择了“确定”按钮 \n");
else
printf("用户选择了“取消”按钮 \n");
return 0;}
和树上的一样的,没改一点
为什么编译的时候却给出:fatal error C1083: Cannot open precompiled header file: 'Debug/win.pch': No such file or directory
望指点
2011年04月19日 05点04分 1
level 1
去掉Messagebox前面的::试试
2011年04月19日 05点04分 2
level 6
VC_yjt 楼主
回复:2楼
没用啊,还是一样的
2011年04月19日 05点04分 3
level 1
回复3楼:
请无视二楼因为他没那么使用过函数....新建一个空工程.把代码复上去.经测试成功
2011年04月19日 05点04分 4
level 1
“::”是什么符号?是C++的么?
2011年04月19日 06点04分 5
level 6
#include<windows.h>
int main(int argc,char*argv)
{
     int var = MessageBox(0,"Hello,Windows 7","title",MB_OKCANCEL);
     if(var == IDOK)
     MessageBox(0,"OK","",MB_OK);
     else
     MessageBox(0,"Cancel","",MB_OK);    
    
     return 0;
}
[抖胸]
2011年04月19日 06点04分 6
level 1
或者少了个 include ?
2011年04月19日 06点04分 7
level 6
#include<windows.h>
int main(int argc,char*argv)
{
     int var = MessageBox(0,"Hello,Windows 7","title",MB_OKCANCEL);
     if(var == IDOK)
     MessageBox(0,"OK","",MB_OK);
     else   if(var == IDCANCEL)
     MessageBox(0,"Cancel","",MB_OK);
     return 0;
}

2011年04月19日 06点04分 8
level 10
int nSelect=::MessageBox(NULL,TEXT("Hello Windows 7"),TEXT("Greetings"),MB_OKCANCEL);
2011年04月19日 06点04分 9
level 10
.
2011年04月19日 06点04分 10
level 6
VC_yjt 楼主
为什么我电脑不能啊,难道是VC的问题?
2011年04月19日 08点04分 11
level 6
VC_yjt 楼主
蛋疼
2011年04月19日 08点04分 12
level 10
回复:12楼
"NULL" 全用大写字母。
2011年04月19日 10点04分 13
level 6
VC_yjt 楼主
回复:13楼

果然,手按快了,没注意到
纠结这么久[撞墙至死]
2011年04月19日 10点04分 14
1