Archived

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

Subotron

Creating a dialogbar-> How to make a pointer to it?

Recommended Posts

I am using a dialog bar in my application, but my problem is I created it like this: m_hDlg = CreateDialog(m_hInstance, MAKEINTRESOURCE(IDD_TOOLBAR), m_hWnd, (DLGPROC)ToolbarProc); Now I want to read out values from buttons, etc. But since I don''t have a pointer to the dialogbar it doesn''t work too well. (Although there are ways around this) So my question is how do I get a pointer to the dialogbar so I can edit/read the values much easier? I really want to get this to work because handling the dialogbar is really a pain without it. Thanks in advance! | Panorama 3D Engine | Contact me | | MSDN | Google | SourceForge |

Share this post


Link to post
Share on other sites
Create a wrapper around the HWND. Maybe something like: (sorry, I can''t force myself to use Humgarian)


  

class DialogBar {
private:
HWND hwnd;
public:
DialogBar(HWND parent, HINSTANCE inst, int id);
WNDPROC ToolbarProc;
//Other logical functions to accomplish what you want

};

...

DialogBar::DialogBar(HWND parent, HINSTANCE inst, int id) :
hwnd(NULL) {

hwnd = CreateDialog(inst, MAKEINTRESOURCE(id), parent,
(DLGPROC)ToolbarProc);
if (!hwnd) throw (something);
}
...



Hope this helps

Share this post


Link to post
Share on other sites