genghis86
August 25th, 1999, 11:33 AM
I am creating a class for drawing Flat comboboxes and flat edit controls and it uses a generic CWnd class as a base class for compatibility with all the controls.
Lets say that class is called "CMyClass". I create 1 variable for a combobox control named "m_Combo" of class "CComboBox". Then I create another 2nd variable named "m_FlatCombo" of class "CMyClass" for the same control. CMyClass draws the combo flat and I need m_Combo to have control over the combobox (add data, etc.).
But when I try to compile the project everything goes well until I run the executable. If compiled in Debug mode I get wincore.cpp errors. If compiled in Release mode, I get illegal operation window. Is there a way not to crash the app?
Maybe I was thinking of leaving variable only 1 variable and creating CComboBox class on the fly (runtime)
I tried putting this in OnInitDialog routine:
CComboBox cbo;
cbo=m_FlatCombo;
cbo.AddString("My New Item");
...
...
How do I set the cbo object to take control over m_FlatCombo variable? PLEASE HELP ME!
----------------
Genghis86
genghis86@hotmail.com
http://genghis86.cjb.net/
ICQ: 10669758
Lets say that class is called "CMyClass". I create 1 variable for a combobox control named "m_Combo" of class "CComboBox". Then I create another 2nd variable named "m_FlatCombo" of class "CMyClass" for the same control. CMyClass draws the combo flat and I need m_Combo to have control over the combobox (add data, etc.).
But when I try to compile the project everything goes well until I run the executable. If compiled in Debug mode I get wincore.cpp errors. If compiled in Release mode, I get illegal operation window. Is there a way not to crash the app?
Maybe I was thinking of leaving variable only 1 variable and creating CComboBox class on the fly (runtime)
I tried putting this in OnInitDialog routine:
CComboBox cbo;
cbo=m_FlatCombo;
cbo.AddString("My New Item");
...
...
How do I set the cbo object to take control over m_FlatCombo variable? PLEASE HELP ME!
----------------
Genghis86
genghis86@hotmail.com
http://genghis86.cjb.net/
ICQ: 10669758