MessageBox的问题!
我新建了一个Window Application并加入一个cpp文件
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lPcmdLine,
int nShowCmd)
{
MessageBox(NULL,"WRONG","DD",MB_OK);//WRONG
return 1;
}
为什么MessageBox用不起来.大家可以试一下!很简单的
问题点数:30、回复次数:9Top
1 楼bohut(●伯虎● )回复于 2003-12-01 09:52:02 得分 0
主窗口尚未建立,不能用MessageBoxTop
2 楼zhangnanonnet(鱼欢)回复于 2003-12-01 09:54:56 得分 0
一楼的说的对。。。Top
3 楼herofyf()回复于 2003-12-01 09:56:26 得分 0
我的意思说连编译都通不过啊!Top
4 楼isdong(有些事情应该忘记)回复于 2003-12-01 09:58:04 得分 30
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MessageBox(NULL,"WRONG","DD",MB_OK);//WRONG
return 0;
}
Top
5 楼mfc168(子非鱼)回复于 2003-12-01 10:28:18 得分 0
提示的错误信息是什么?上面的代码如果是你考过来的话,就已经存在问题了,{}的全角半角问题Top
6 楼herofyf()回复于 2003-12-01 16:06:36 得分 0
unresolved external symbol __imp__MessageBoxA@16Top
7 楼alfwolf(木马煞)回复于 2003-12-01 16:17:49 得分 0
呵呵
试试::MessageBox(...)Top
8 楼alfwolf(木马煞)回复于 2003-12-01 16:19:25 得分 0
因为你直接使用MessageBox,编译器以为你调用的是CWnd或者CWindow的MessageBox()而你的代码并非MFC程序Top
9 楼bluebohe(薄荷)回复于 2003-12-01 16:24:00 得分 0
#include "stdafx.h"
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MessageBox(NULL,"WRONG","DD",MB_OK);//WRONG
return 0;
}
Top




