NntpGetNextArticleEx Function  
 
BOOL WINAPI NntpGetNextArticleEx(
  HCLIENT hClient,  
  LPNEWSARTICLEEX lpArticleEx  
);

The NntpGetNextArticleEx function returns information about the next article in the currently selected newsgroup.

Parameters

hClient
Handle to the client session.
lpArticle
A pointer to a NEWSARTICLEEX structure which will contain information about the next available article in the currently selected directory.

Return Value

If the function succeeds, the return value is non-zero. If there are no more articles in the current newsgroup, or the function fails, the return value is zero. To get extended error information, call NntpGetLastError.

Remarks

The NntpGetNextArticleEx function returns information about the next available article in the currently selected newsgroup. This function is used in conjunction with the NntpGetFirstArticleEx function to enumerate all of the articles in the newsgroup. Typically this is used to provide the user with a list of articles to access. This function provides support for servers which use 64-bit article IDs.

While the articles in the newsgroup are being listed, the client cannot retrieve the contents of a specific article. For example, the NntpGetArticleEx function cannot be called while inside a loop calling NntpGetNextArticleEx. 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 NttpGetArticleEx for each article number to retrieve the article text.

Example

NEWSARTICLEEX newsArticle;
BOOL bResult;
INT nResult;

// List all articles in the current group
nResult = NntpListArticlesEx(hClient, (ULONGLONG)-1, (ULONGLONG)-1);

if (nResult == NNTP_ERROR)
{
    TCHAR szError[ASTRING];
    DWORD dwError = NntpGetLastError();

    NntpGetErrorString(dwError, szError, ASTRING);
    _ftprintf(stderr, _T("Error %08x: %s\n"), dwError, szError);
    return;
}

// Get each article in the current newsgroup, printing the article
// number and the subject of the article
bResult = NntpGetNextArticleEx(hClient, &newsArticle);

while (bResult)
{
    _tprintf(_T("%I64u %s\n"), newsArticle.nArticleId, newsArticle.szSubject);
    bResult = NntpGetNextArticleEx(hClient, &newsArticle);
}

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csnwsv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also