ATL Dialogs
-
using VC++ 2005 Pro, I created an ATL/COM dll, added a simple object, then created a dialog control with a combo box and some other controls. Now I want to populate that combo box with some strings -- how do I do that? I use MFC a lot, so I know in MFC how to use ClassWizard to create a class name to the control, then call its AddString() method. But I don't see anything equilivant -- in VC++ 2005 I hold Ctrl key down and double click the control -- it brings up a window where I can assign class name, but only an integer. So I tried to call GetDlgItem(), but the compiler will not let me typecast its return value to CCombBox* as I can do in MFC. Do I have to resort to sending normal win32 api messages to populate the combo box list?:confused::confused: Thanks
-
using VC++ 2005 Pro, I created an ATL/COM dll, added a simple object, then created a dialog control with a combo box and some other controls. Now I want to populate that combo box with some strings -- how do I do that? I use MFC a lot, so I know in MFC how to use ClassWizard to create a class name to the control, then call its AddString() method. But I don't see anything equilivant -- in VC++ 2005 I hold Ctrl key down and double click the control -- it brings up a window where I can assign class name, but only an integer. So I tried to call GetDlgItem(), but the compiler will not let me typecast its return value to CCombBox* as I can do in MFC. Do I have to resort to sending normal win32 api messages to populate the combo box list?:confused::confused: Thanks
Stober wrote:
Do I have to resort to sending normal win32 api messages to populate the combo box list?
Yes, if you stick with plain ATL. You can also use WTL, which has the control wrappers that you're looking for. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ