I call two different dialogboxes (created in Resource editor) from unmanaged C++ like so:
iRet = ::DialogBox(::GetModuleHandle("T_Calc.dll"), MAKEINTRESOURCE(IDD_DIALOG1), GetDesktopWindow(), (DLGPROC)Calculate::ToldDlgProc);
(The call to the other dialogbox is exactly the same, but the resource name is IDD_DIALOG2)
When I run in Debug mode (i.e. press F5), everything works as it should. However, when I compile the Release project and run the resulting Setup, the two dialogboxes show only the controls in the dialogbox. The background is transparent, and the title bar and border are missing. They still work (I can enter info into an edit box, and press the OK and Cancel buttons), but they're very hard to see.
Anyone have any ideas? I'm talking to an MS tech support person about this, but he's currently stumped.
The callback function for the call above looks like:
bool CALLBACK Calculate::ToldDlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
/* - Initialize dialog box */
case WM_INITDIALOG:
/* - Set the dialog box title */
::SetWindowText(hWnd, title);
/* - Default the input text box */
::SetDlgItemText(hWnd, IDC_EDIT1, sInputData);
/* - Set the prompt text */
::SetDlgItemText(hWnd, IDC_EDIT2, prompt);
return true;
case WM_COMMAND:
switch(LOWORD(wParam))
{
/* - OK is pressed */
case IDOK:
/* - If there is nothing in the text box, blank out global variable */
if (!GetDlgItemText(hWnd,IDC_EDIT1,sInputData,sizeof sInputData))
*sInputData = 0;
/* - Cancel is pressed */
case IDCANCEL:
EndDialog(hWnd, wParam);
return true;
}
break;
}
return false;
} // ToldDlgProc