Subj : Re: Modal dialog box - how? To : borland.public.cpp.borlandcpp From : David Ayre Date : Thu Jul 08 2004 07:47 am Hi Bob, I tried what you suggested but must have got it wrong somewhere. Any ideas? Cheers, David I used this statement in the routine that calls the modal dialog box. It won't compile as it says there's a type mimatch for GetInvNote in the calling statement. What am I doing wrong? DialogBox(hInst,MAKEINTRESOURCE(NOTES_DLG),hWnd,GetInvNote); This is the entry in the header file static BOOL CALLBACK GetInvNote(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam); This is the entry in the cpp file. #pragma argsused static BOOL CALLBACK GetInvNote(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam) { switch (iMessage) { case WM_INITDIALOG : { //SetIcon("ICN_MAILER"); //CentreWindow(); } break; case WM_COMMAND : switch (wParam) { case BTN_MODALOK : { char acCode[15]; GetDlgItemText(hDlg, TXT_NOMINAL, (LPSTR)acCode,sizeof(acCode)); if(acCode[0] == '\0')break; WritePrivateProfileString("INVOICE", "NOTE", (LPSTR)acCode, NMS_INIFILE); } case BTN_MODALCANCEL : EndDialog(hDlg,0); return TRUE; //SendMessage(hWnd,WM_CLOSE,0,0L); break; default : return TRUE; } break; case WM_CLOSE : { PostMessage(hDlg,WM_COMMAND,BTN_MODALOK,0); } break; default : break; } return FALSE; } .