if(m_URLList.FindString(-1,strCompany)==LB_ERR)在CListBox中-1表示什么意思?

解决方案 »

  1.   

    if(m_URLList.FindString(-1,strCompany)==LB_ERR)
    {
        m_URLList.AddString(strCompany);
    }
    在CListBox 中
    strCompany里的字符串没有重复的==LB_ERR,执行AddString(strCompany);
    那-1表示什么?
      

  2.   

    看一下 FindString 的函数文档就搞定了
    下次看文档先
      

  3.   

    CListBox::FindString 
    int FindString( int nStartAfter, LPCTSTR lpszItem ) const;Return ValueThe zero-based index of the matching item, or LB_ERR if the search was unsuccessful.ParametersnStartAfterContains the zero-based index of the item before the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by nStartAfter. If nStartAfter is –1, the entire list box is searched from the beginning.
    这句:If nStartAfter is –1, the entire list box is searched from the beginning.
      

  4.   

    对于逻辑之当然是用0表示FALSE
    非0表示TRUE