Modeless API dialog hangs after creation
-
Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL.
CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack);
When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callbackswitch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;
-
Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL.
CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack);
When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callbackswitch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;
KnaveR wrote: which calls CreateDialog to make a modeless DLL. Did you mean modeless dialog? KnaveR wrote: but locks-up as soon as i click or drag mouse into the dialog. Could you explain a bit on what you mean by that.
- Nilesh "Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
-
Hello All, I have created a DLL that has an export which calls CreateDialog to make a modeless DLL.
CreateDialog(hDLL, MAKEINTRESOURCE(IDD_DIALOG1), mWnd, (DLGPROC)DlgCallBack);
When called, the dialog pops up and everything seems to go right... but locks-up as soon as i click or drag mouse into the dialog. My guess is that something might be going wrong with the way I handle messages or something weird caused by using a dll that I am not aware of, but am not sure since i am new to windows programming. Here is the code in my callbackswitch(uMsg) { case WM_COMMAND: switch(wParam){ case IDOK: return TRUE; } break; case WM_DESTROY: PostQuitMessage(0); return true; case WM_CLOSE: DestroyWindow(hwnd); return TRUE; } return FALSE;
KnaveR wrote: return FALSE; Instead of above call
DefDlgProc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
KnaveR wrote: return FALSE; Instead of above call
DefDlgProc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
Thnx to both of you.... Sorry for the late reply Sorry for not properly specifying, but by locking up i ment the infamous " has encountered a problem and needs to close" was poping up. For further clarification on what causes this lock up, this occurs anytime I click on the window of the app (mIRC) that calls my dll or move the mouse into my dialog's window. Anyways, after using DefDlgProc, this problem goes away, but the calling app (mIRC) immediately terminates without notice. Any ideas?