Tech Support > Microsoft Windows > Development Resources > CComboBox
CComboBox
Posted by Andreas Beresko on December 17th, 2003


Hi,

i have an ComboBox Element in a Dialog (added in Visual Studio with Ressorce
Editor).
I also added a member control variable (m_CMyCombo).
But when i try to add a text with m_CMyCombo.addString("text") (Debug
Assertion Failed afxwin2.inl, l:735)...
when I debug i see, that m_CMyCombo doesn't belong to any Window (normally
it has to be belong to the Ressource IDD_COMBO1 but it's value is 0x0000)
It's curios, but the same Thing works with a CEdit variable (m_sText) and
the error only occurs if I create a Dialog with these Controls, if Control
Elements are in Main Window it works..


any idea? thx (from Germany - sorry for my english *g*)

Andreas


Posted by Tim Robinson on December 17th, 2003


Did you add m_CMyCombo using Class Wizard? If so, it should have added a
DDX_Control line to DoDataExchange. If that's not there, either add the
DDX_Control line yourself to 'connect' m_CMyCombo to IDD_COMBO1, or remove
all traces of m_CMyCombo and add it again using Class Wizard.

--
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/

"Andreas Beresko" <SOULJA2000@GMX.DE> wrote in message
news:brqkgj$4vc$03$1@news.t-online.com...


Posted by Andreas Beresko on December 18th, 2003


Hi,

Thx for answer, but it is (of course) there ->

//{{AFX_DATA_MAP(CConnectDlg)

DDX_Control(pDX, IDC_COMBO1, m_ctrlCom); <---

Error Message is: DEBUG ASSERTION FAILE AFWIN2.INL LINE 735 - when I = debug
i see, that my control isn't a valid window, that causes the assertion . But
why ??



"Andreas Beresko" <SOULJA2000@GMX.DE> schrieb im Newsbeitrag
news:brqkgj$4vc$03$1@news.t-online.com...


Posted by Tim Robinson on December 18th, 2003


Maybe your dialog box doesn't have an IDC_COMBO1 control?

--
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/

"Andreas Beresko" <SOULJA2000@GMX.DE> wrote in message
news:brruu6$kb4$01$1@news.t-online.com...


Posted by Andreas Beresko on December 18th, 2003


Thxm but I got... can only access to the control variables AFTER calling
OnDlgInit() ...

thx anyway
"Tim Robinson" <tim.at.gaat.freeserve.co.uk@invalid.com> schrieb im
Newsbeitrag news:brt0b4$75sv4$1@ID-103400.news.uni-berlin.de...



Similar Posts