请问:
m_ListView.InsertItem(0,inet_ntoa(server.sin_addr));
m_ListView.SetItem(index,1,LVIF_TEXT,StrPort, 0, 0, 0,0);
中的参数怎么设置?是什么意思?

解决方案 »

  1.   

    int InsertItem( int nItem, LPCTSTR lpszItem );nItem
    Index of the item to be inserted.
    lpszItem
     Address of a string containing the item’s label, or LPSTR_TEXTCALLBACK if the item is a callback itemBOOL SetItem( int nItem, int nSubItem, UINT nMask, LPCTSTR lpszItem, int nImage, UINT nState, UINT nStateMask, LPARAM lParam );
    nItemIndex of the item whose attributes are to be set.nSubItemIndex of the subitem whose attributes are to be set.nMaskSpecifies which attributes are to be set (see the Res).lpszItemAddress of a null-terminated string specifying the item’s label.nImageIndex of the item’s image within the image list.nStateSpecifies values for states to be changed (see the Res).nStateMaskSpecifies which states are to be changed (see the Res).lParamA 32-bit application-specific value to be associated with the item.ResSets some or all of a list view item’s attributes.The iItem and iSubItem members of the LVITEM structure and the nItem and nSubItem parameters identify the item and subitem whose attributes are to be set.The mask member of the LVITEM structure and the nMask parameter specify which item attributes are to be set: LVIF_TEXT   The pszText member or the lpszItem parameter is the address of a null-terminated string; the cchTextMax member is ignored.
    LVIF_STATE   The stateMask member or nStateMask parameter specifies which item states to change and the state member or nState parameter contains the values for those states.