Archived

This topic is now archived and is closed to further replies.

Win32 Dialog Box C++ class in a DLL

This topic is 4915 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All I created a c++ class that implements a win32 dialog, something like: class Win32ConfigDlg { public: Win32ConfigDlg(HINSTANCE hinst) { m_hinst = hinst; } bool showDialog(void) private: static BOOL CALLBACK DlgProc(HWND hwnd, UINT umsg, WPARAM wpar, LPARAM lpar); HINSTANCE m_hinst; }; inside showDialog there is something like: DialogBox(m_hinst, MAKEINTRESOURCE(IDD_CFG_DLG), NULL, DlgProc); the above class is called from a DLL, I am able to see the dialog and access its controls such as buttons, but the thing that I can not explian is: the dialg itself is freezed and can not be moved. I can not understand why the controls are painted while the dialog itself is not repainted. things seems to work from outside the dll. any help , hints is appreciated. Silvia

Share this post


Link to post
Share on other sites
Which hInstance are you passing to the dialog? If the resource for the dialog is included in the dll, you need to pass the hInstance for the dll. HINSTANCE and HMODULE are the same thing, so if you''re using LoadLibrary to load the dll, pass the returned HMODULE in as hinst. If the dll is statically linked, use GetModuleHandle passing the name of the dll file.

Does your DlgProc use DefDlgProc for default processing? If it uses DefWindowProc, switch to using DefDlgProc instead and see if that resolves the problem.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Silvia,

I amtrying to create a dialog box inside a win32 DLL, but I am having issues with it.
Could you please post the code that fixed your problem, I have the same issue. My e-mail address is shabeer.qadri@echostar.com

Thank you, I appreciate your help.

Shabeer

Share this post


Link to post
Share on other sites