我重装了N遍还是未定义啊,难道是要加什么头文件吗?
各位大大一定要告我啊
这是源码,麻烦给看看
#include <windows.h>
BOOL DlgProc(HWND, UINT, WPARAM, LPARAM) ;
HINSTANCE hInst;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)
{
//添加处理代码;
hInst=hInstance;
//CreateDialogParam(hInstance,MAKEINTRESOURCE(1000),0,(DLGPROC)DlgProc,(1000));
DialogBoxParam(hInstance,MAKEINTRESOURCE(1000),0,(DLGPROC)DlgProc,(1000));
return TRUE;
}
BOOL DlgProc (HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
int lowID;
int hmenu;
BOOL ok;
int hbmp1,hbmp2;
DWORD error;
char* save=new char; 就这两行爆未定义new操作符
char* open=new char;
switch (uMsg){
case WM_INITDIALOG:
LoadIcon( hInst , MAKEINTRESOURCE(10));
hmenu=LoadMenu(hInst,10000);
ok=SetMenu(hWnd,hmenu);
if (ok==0) MessageBox(hWnd,"设置菜单错误","出错啦",MB_OK);
hbmp1=LoadBitmap(hInst,11);
hbmp2=LoadBitmap(hInst,12);
break;
case WM_COMMAND:
lowID=LOWORD(wParam);
if (lowID==1001 || lowID==10004)
PostMessage(hWnd,WM_CLOSE,NULL,NULL);
if (lowID==1015)
SendDlgItemMessage(hWnd,1002,STM_SETIMAGE,IMAGE_BITMAP,hbmp1); 另外再问问,为什么发送了更换图片的消息确没有更换图片呢?
break;
case WM_CLOSE:
EndDialog(hWnd,FALSE);
DeleteObject(hbmp1);
DeleteObject(hbmp2);
break;
default:
return FALSE;
}
return TRUE;
}