现在在下拉表中可以选取对象,但是如果在下拉编辑框中输入一个完整的名称然后 打回车,就会报错
这是为什么呢?有没有谁知道解决方法,谢拉~

解决方案 »

  1.   

    因为我才发了2个帖都没结呢,新手
    void CMyDlg::OnEditchangeCombo3() 
    {
    pointReady();
    MSXML::IXMLDOMNodeListPtr nodelist1 = NULL;
    nodelist1=pDoc3->selectNodes("root/point");
    nodelist1->get_length(&nodecount3); 
    CString strcourse,str;
    m_endposition.GetWindowText(strcourse);
    if (strcourse!="")
    {
    m_e.Insert(0,strcourse);
    int iCount=m_position.GetCount();
    for(long i=0;i<iCount;i++)
    m_endposition.DeleteString(0);
    for(int j=0;j<nodecount3;j++)
    {
    str=allpoint[j].name;
    if(str.Find(strcourse,0)!=-1)
    {
    m_endposition.AddString(str);
    }
    }
    m_endposition.ShowDropDown();
    SetCursor(LoadCursor(NULL,IDC_ARROW));    
    m_endposition.SetWindowText(strcourse);
    m_endposition.SetEditSel(strcourse.GetAllocLength(),strcourse.GetAllocLength());
    }
    }
      

  2.   

    把代码发给我,给你调试一下 [email protected]
      

  3.   

    你自己自绘的CComboBox控件???
      

  4.   

    不是啊,用的工具栏里的combobox
    上面那个是combobox里的代码
    怎么改一下
    让回车后不出错
    现在点回车
    会出现对话框 说内存错误