   dialog box not showing
  My dialog box is not showing. Here is my code:   LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam){static int width=0,height=0;static Tool** tools;PAINTSTRUCT ps;HDC hdc;switch(msg){case WM_CREATE:tools=(Tool**)(((LPCREATESTRUCT)lParam)->lpCreateParams);return 0;case WM_PAINT:hdc=BeginPaint(hwnd,&ps);EndPaint(hwnd,&ps);return 0;case WM_COMMAND:switch(LOWORD(wParam)){case ID_FILE_NEW:{BitmapData* blank=new BitmapData;// here''s where it gives me the error:if(DialogBoxParam(GetModuleHandle(0),MAKEINTRESOURCE(IDD_NEW),hwnd,NewProc,(LPARAM)blank)==-1)   {char buffer[256];FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,0,GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),buffer,256,0);MessageBox(hwnd,buffer,"Error",MB_OK|MB_ICONERROR);delete blank;break;}images.push_back(blank);Window* win=new Window(blank,0,tools);// must put child window in list before calling// win->create becuase ShowWindow sends a // WM_PAINT messagechildWindows.push_back(win);if(!win->create(hwnd,blank->title,0,0,blank->width+10,blank->height+10)){MessageBox(hwnd,"Couldn''t create window!","Error",MB_ICONERROR);}}break;case ID_FILE_OPEN:{bmp::Bitmap* data=bmp::LoadBitmap("data/test.bmp");if(!data){break;}BitmapData* blank=new BitmapData;blank->width=data->width;blank->height=data->height;blank->data=data->data;wsprintf(blank->location,"data/test.bmp");wsprintf(blank->title,"test.bmp");images.push_back(blank);Window* win=new Window(blank,0,tools);childWindows.push_back(win);if(!win->create(hwnd,"test",0,0,blank->width+10,blank->height+10)){MessageBox(hwnd,"Couldn''t create window!","Error",MB_ICONERROR);}delete data;break;}case ID_WINDOW_STUFF:break;case ID_FILE_SAVE:{HWND child=(HWND)SendMessage(client,WM_MDIGETACTIVE,0,0);SendMessage(child,WM_COMMAND,wParam,lParam);}break;// MDI window commandsdefault:if(LOWORD(lParam)>=50000){break;}else{HWND child=(HWND)SendMessage(client,WM_MDIGETACTIVE,0,0);if(child){// send a syscommand because it is not a menu item// (ie. when maximized the child window minimize,// restore,and close buttons are put in the menu,// when pressed they send a command message, which// then has to be sent to the current child window// as a syscommandSendMessage(child,WM_SYSCOMMAND,wParam,lParam);}}}return 0;case WM_MOVE:x=LOWORD(lParam);y=HIWORD(lParam);return 0;case WM_SIZE:width=LOWORD(lParam);height=HIWORD(lParam);// resize the client windowSetWindowPos(client,0,0,0,width-toolBar_width,height,SWP_NOZORDER);// reposition toolbarSetWindowPos(toolBar,0,width-toolBar_width,0,toolBar_width,height,SWP_SHOWWINDOW);return 0;case WM_ACTIVATE:{RECT r;GetWindowRect(hwnd,&r);width=r.right-r.left;height=r.bottom-r.top;}break;case WM_CLOSE:{bool exit=1;for(int i=0;i<childWindows.size();i++)if(!childWindows[i]->exit()){exit=0;break;}// dont exit if the user clicked cancel or doesnt have// any unsaved imagesif(exit)DestroyWindow(hwnd);}return 0;case WM_DESTROY:PostQuitMessage(0);return 0;}return DefFrameProc(hwnd,client,msg,wParam,lParam);}GetLastError says that the handle to the window is invalid, but I don''t see how that''s possible. I get it strait from the parameter. Any ideas on why its not showing?thanks brassfish