我在VC++6.0环境下,做了一个对话框,在这个对话框上加了一个下拉框,并把它的属性设置成dropdown,可以编辑这个框,定义为 COMBO  变量 m_Combo_Customer,我怎样获取我选择这个下拉框中的变量值或者输入的编辑内容,我用
CString Customer;
   Customer=m_Combo_Customer.GetWindowText()
不能通过编译,说Customer=m_Combo_Customer.GetWindowText()不能为0参数, m_Combo_Customer.GetWindowText()扩号中的参数是&Cstring 的,我要怎样改

解决方案 »

  1.   

    CString st;
    m_Combo_Customer.GetWindowText(&st);
      

  2.   

    // The pointer to my combo box.
    extern CComboBox* pmyComboBox;// Dump all of the items in the combo box.
    #ifdef _DEBUG
       CString str, str2;
       int n;
       for (int i=0;i < pmyComboBox->GetCount();i++)
       {
          n = pmyComboBox->GetLBTextLen( i );
          pmyComboBox->GetLBText( i, str.GetBuffer(n) );
          str.ReleaseBuffer();      str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
          afxDump << str2;
       }
    #endif因为是dropdown,取得当前所选用GetCurSel
      

  3.   

    如果用户直接在edit框里输入呢?那里的字符怎么取得?