qq头像女生蓝色荧光系:请教关于c++的combo box的用法

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/26 09:02:32
我在对话框中添加了一个combo box,请问如何在程序里动态增加列表(item),请说明的详细一点,请用非MFC的方法。
谢谢!!
请用非MFC的方法。

HWND hWndCombo = ::GetDlgItem( hWndDlg, IDCOMBO );
LPCTSTR szTemp = TEXT( "ABC" );
::SendMessage( hWndCombo, CB_ADDSTRING, 0,
(LPARAM) (LPCTSTR) szTemp );

CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LIST1);
if(pListBox != NULL)
pListBox ->AddString

CListBox::AddString
int AddString( LPCTSTR lpszItem );