Hey guys, I'm new to this forum so nice to meet you all :D
I'm really bugged by a weird bug that prevents my dialog from showing up, however the buttons show up twice, one overlapping the other. I saw other threads that discusses about this but I'm afraid I can't find a way out through them.
I have already found the problem ( i hope) and (sort of) fixed itby copying and pasting the DialogProcedure code from winprog which i have used as my reference for the project.
here's the code from winprog:
BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDCANCEL:
EndDialog(hwnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
and here's mine:
BOOL CALLBACK CalculatorProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_CANCEL:
EndDialog(hwnd,ID_CANCEL);
break;
}
break;
}
return TRUE;
}
i tried replacing my codes for the WinMain and WinProc on the tutorial's solution and the dialog still worked finely. The difference appeared when i replaced my dialog procedure with the tutorial's. When i pasted the tutorial's procedure, I only changed the name of the variables to match mine, in the end, it completely matches mine. Is there something i missed or am i going blind? :(