BOOL GetNextGroup( |
|
LPNEWSGROUP lpGroup |
|
); |
BOOL GetNextGroup( |
|
LPNEWSGROUPEX lpGroup |
|
); |
The GetNextGroup method returns information about the next
available newsgroup.
Parameters
- lpGroup
- A pointer to a NEWSGROUP or
NEWSGROUPEX structure
which will contain information about the next available
newsgroup. If the server can potentially return very large article
IDs, it is recommended that you use the
NEWSGROUPEX structure.
Return Value
If the method succeeds, the return value is non-zero. If there are
no more newsgroups available, or the method fails, the return value
is zero. To get extended error information, call
GetLastError.
Remarks
The GetNextGroup method returns information about the next
newsgroup on the server. This method is used in conjunction with the
GetFirstGroup method to enumerate all of the available
newsgroups. Typically this is used to provide the user with a list of
newsgroups to select.
While the the newsgroups are being listed, the client cannot
select a newsgroup or retrieve the contents of a specific article.
The client should store those newsgroups which it wants to retrieve
articles from, and then once all of the newsgroups have been listed,
it can then select each newsgroup and retrieve the available articles
from that group.
Example
// List all available newsgroups
if (pClient->ListGroups() == NNTP_ERROR)
pClient->ShowError();
else
{
NEWSGROUP newsGroup;
BOOL bResult;
// Get each newsgroup, printing the article range and
// the name of the group
bResult = pClient->GetFirstGroup(&newsGroup);
while (bResult)
{
printf("%ld %ld %s\n", newsGroup.nFirstArticle,
newsGroup.nLastArticle,
newsGroup.szName);
bResult = pClient->GetNextGroup(&newsGroup);
}
}
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csnwsv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
GetFirstArticle,
GetFirstGroup,
GetNextArticle,
ListArticles,
ListGroups,
SelectGroup,
NEWSARTICLE,
NEWSGROUP
|