ReBars (urgent)
-
I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this:
CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel();
etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help! -
I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this:
CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel();
etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help!If this is really urgent, why can't you provide more information on 'some unhandled exception'? Is your combo a child of mainframe, or rather it's located on rebar? Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
-
I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this:
CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel();
etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help!Even though
CMainFrame
may be getting messages sent by it, the combobox is not actually a direct child. SoGetDlgItem()
is returningNULL
, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member ofCMainFrame
) and use that to obtain the combobox handle.---
Shog9 If I could sleep forever, I could forget about everything...
-
Even though
CMainFrame
may be getting messages sent by it, the combobox is not actually a direct child. SoGetDlgItem()
is returningNULL
, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member ofCMainFrame
) and use that to obtain the combobox handle.---
Shog9 If I could sleep forever, I could forget about everything...
-
Even though
CMainFrame
may be getting messages sent by it, the combobox is not actually a direct child. SoGetDlgItem()
is returningNULL
, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member ofCMainFrame
) and use that to obtain the combobox handle.---
Shog9 If I could sleep forever, I could forget about everything...
-
Thanks, I've got your idea. But how exactly should I obtain a handle to the ReBar window? (sorry, I'm just a beginner)
It should be a member of your
CMainFrame
class. Probably it's calledm_wndReBar
. Note that the ReBar control itself only contains other windows, so it could contain the combo box itself, or the combo box could be on a dialog bar contained by the ReBar; i'm not sure how you set this up, so i can't say for sure. If you *are* using a dialog bar, there'll be another member ofCMainFrame
for that. Poke around a bit, it should all be clear.---
Shog9 If I could sleep forever, I could forget about everything...
-
It should be a member of your
CMainFrame
class. Probably it's calledm_wndReBar
. Note that the ReBar control itself only contains other windows, so it could contain the combo box itself, or the combo box could be on a dialog bar contained by the ReBar; i'm not sure how you set this up, so i can't say for sure. If you *are* using a dialog bar, there'll be another member ofCMainFrame
for that. Poke around a bit, it should all be clear.---
Shog9 If I could sleep forever, I could forget about everything...