BOOL GetNextArticle( |
|
LPNEWSARTICLE lpArticle |
|
); |
BOOL GetNextArticle( |
|
LPNEWSARTICLEEX lpArticle |
|
); |
The GetNextArticle method returns information about the
next article in the currently selected newsgroup.
Parameters
- lpArticle
- A pointer to a NEWSARTICLE
or NEWSARTICLEEX
structure which will contain information about the next available
article in the currently selected directory. If the server can
potentially return very large article IDs, it is recommended that
you use the
NEWSARTICLEEX structure.
Return Value
If the method succeeds, the return value is non-zero. If there are
no more articles in the current newsgroup, or the method fails, the
return value is zero. To get extended error information, call
GetLastError.
Remarks
The GetNextArticle method returns information about the
next available article in the currently selected newsgroup. This
method is used in conjunction with the GetFirstArticle method
to enumerate all of the articles in the newsgroup. Typically this is
used to provide the user with a list of articles to access.
While the articles in the newsgroup are being listed, the client
cannot retrieve the contents of a specific article. For example, the
GetArticle method cannot be called while inside a loop calling
GetNextArticle. The client should store those articles which
it wants to retrieve in an array, and then once all of the articles
have been listed, it can begin calling NttpGetArticle for each
article number to retrieve the article text.
Example
// List all articles in the current group
if (pClient->ListArticles() == NNTP_ERROR)
pClient->ShowError();
else
{
NEWSARTICLE newsArticle;
BOOL bResult;
// Get each article in the current newsgroup, printing the article
// number and the subject of the article
bResult = pClient->GetFirstArticle(&newsArticle);
while (bResult)
{
_tprintf(_T("%ld %s\n"), newsArticle.nArticleId, newsArticle.szSubject);
bResult = pClient->GetNextArticle(&newsArticle);
}
}
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
GetArticle,
GetFirstArticle,
GetFirstGroup,
GetNextGroup,
ListArticles,
ListGroups,
SelectGroup,
NEWSARTICLE,
NEWSGROUP
|