newntui/activex/groupscombo/src/groupscomboctl.cpp
//-----------------------------------------------------------------------------------
// Query server for all available groups. Fills the list with returned groups name.
//----------------------------------------------------------------------------------- 
Query server for all available groups. Fills the list with returned groups name.
Query server for all available groups . Fills the list with returned groups name .
void CGroupsComboCtrl::FillList(void) {
register i;
CString serverCall;
CString serverResults;
CString spaces;
    m_ElementsList.DeleteAllItems();
    serverCall.Format("group info");
	EvaluateSync(serverCall,&serverResults);
	int     line   = 0;
	BOOL    inside = FALSE;
	CString name   ="";
	for(i=0;i<serverResults.GetLength();i++) {
		if(serverResults[i]!=' ') {
			inside=TRUE;
		}
		if(inside==TRUE && serverResults[i]!=' ') name+=serverResults[i];
		if((serverResults[i]==' ' || i==serverResults.GetLength()-1) && inside==TRUE) {
			inside=FALSE;
	        m_ElementsList.InsertItem(i,name,0);
			name = "";
		}
	}
    if(m_ElementsList.GetSelectedCount()>0) FillElementsList();
}
void CGroupsComboCtrl :: FillList ( void ) { register i ; CString serverCall ; CString serverResults ; CString spaces ; m_ElementsList . DeleteAllItems ( ) ; serverCall . Format ( " " ) ; EvaluateSync ( serverCall , & serverResults ) ; int line = 0 ; BOOL inside = FALSE ; CString name = " " ; for ( i = 0 ; i < serverResults . GetLength ( ) ; i ++ ) { if ( serverResults [ i ] != ' ' ) { inside = TRUE ; } if ( inside == TRUE && serverResults [ i ] != ' ' ) name += serverResults [ i ] ; if ( ( serverResults [ i ] == ' ' || i == serverResults . GetLength ( ) - 1 ) && inside == TRUE ) { inside = FALSE ; m_ElementsList . InsertItem ( i , name , 0 ) ; name = " " ; } } if ( m_ElementsList . GetSelectedCount ( ) > 0 ) FillElementsList ( ) ; }
Query server for all available groups.
Query server for all available groups .
// Removes all items from the list // Queries the server for available categories for the spesified selection. // serverResults string now will contain the complete list of redable // group names separated by spaces. ***No spacves in the group name! // Now we will fill the list with groups names, extracting them from  // the "serverResults".  // Entering group name // Adding new symbol to the group // Exiting query substring - need to insert results into the list // Inserting new item into the combobox // Different group/groups selection will automatically re-calculate the  // selected elements.