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

Started by
1 comment, last by Subotron 21 years, 1 month ago
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 |
Advertisement
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
Yes that should do the trick tnx!

| Panorama 3D Engine | Contact me |
| MSDN | Google | SourceForge |

This topic is closed to new replies.

Advertisement