- ultimatetcp-ip42_src.zip
- Ultimate TCP-IP
- Include
- license.htm
- ReadMe.htm
- Security
- Include
- Lib
- TestCert.pfx
- Res
- certif.bmp
- certif_m.bmp
- icon_cer_l.ico
- icon_cer_s.ico
- key.bmp
- location.bmp
- location_m.bmp
- location_s.bmp
- location_s_m.bmp
- SecurityRes.h
- SecurityRes.rc
- store.bmp
- store_m.bmp
- SecureServers
- Source
- UTSecureLayer
- Servers
- source
- ultimatetcp-ip42_samples.zip
- ActiveX
- BuildAll
- Demos
- Examples
- Client
- ASP
- MFC
- Imap4
- Nntp
- SDK
- DNS
- Finger
- Ftp
- History
- Http
- Mail
- MX Lookup
- Ping
- UDP
- VisualBasic
- Dns
- Finger
- Ftp
- History
- Http
- Imap4
- Mail
- MartsMail
- Nntp
- Ping
- Socket
- UDPSocket
- Master.dsw
- Master.sln
- Server
- ASP
- MFC
- SampleServer
- SDK
- AccessControlServerDemo
- Finger
- Ftp
- Http
- Mail
- VisualBasic
- service
- svrtest
- Examples
- Client
- Echo
- FTPs
- Https
- Imap4s
- Mail
- MasterS.dsw
- MasterS.sln
- Server
- Echo
- FTPs
- Https
- Mail
- Test_Del
- Util
- CertManager
- ultimatetcp-ip42_docs.zip
|
// MyNntpClass.cpp: implementation of the MyNntpClass class.
//
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "NNTPclient.h"
#include "NNTPclientDlg.h"
#include "MyNntpClass.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMyNntpClass::CMyNntpClass()
{
m_pPrntDlg = NULL;
}
CMyNntpClass::~CMyNntpClass()
{
}
/***************************************************
IsAborted
This virtual function is called during time consuming
operations to check if we want to abort operatin
For this sample we will return the inverse of the
aborted button.
Params
none
Return
TRUE - abort operation
FALSE - continue
****************************************************/
BOOL CMyNntpClass::IsAborted() {
return m_pPrntDlg->m_bisAborted;
}
/***************************************************
Set the parent window to bo our dialog window
we will use deligation to assign who is the parent window of
this class object so we can get access to the parents memeber controls
***************************************************/
void CMyNntpClass::SetParentWindow( CNNTPclientDlg *parentDlg){
m_pPrntDlg = parentDlg;
}
/***************************************************
when the command
LIST GROUPS
is issued. Each goup title received will passed to this
call back function
In this example we will update the News groups list
as soon as we receive them.
If we need to abort this function we would return
FALSE
***************************************************/
int CMyNntpClass::OnNGetNewsGroupList(LPCSTR newsGroupTitle) {
m_pPrntDlg->m_listGroup.AddString (WC(newsGroupTitle));
m_pPrntDlg->m_staticWindow.SetWindowText(WC(newsGroupTitle));
return TRUE;
}
/***************************************************
OnNGetArticleList
is called when the user calls NGetArticleList.
For each article received we will receive:
LPCSTR artId - The article ID
LPCSTR subject - The string of the article subject
LPCSTR author - the name or/and email of the authur the article
LPCSTR date - a string containing the date of the article
LPCSTR refrence - the other articles refrenced in this article
LPCSTR BytesCount - number of bytes in the artilce
LPCSTR NumberOfLines - number of lines in the arrticle
Return:
If we want to abort this process we would return FALSE
otherwise, true is returned.
****************************************************/
int CMyNntpClass::OnNGetArticleList(LPCSTR artId, LPCSTR subject,LPCSTR author,LPCSTR date, LPCSTR refrence,LPCSTR BytesCount, LPCSTR NumberOfLines, LPCSTR /* xrefs */ ){
CString statusMessage;
CUT_HeaderEncoding he;
char szCharSet[80];
// v4.2 Wonder if decoding should be built into the nntp classes...
// update the parent class memebers so they can be used in the OnInsertItem, decoding on the fly
m_pPrntDlg->m_strSubject = he.Decode(subject, szCharSet);
m_pPrntDlg->m_strAuthor = he.Decode(author, szCharSet);
m_pPrntDlg->m_strDate = date;
m_pPrntDlg->m_strRefrence = refrence;
m_pPrntDlg->m_strBytesCount = BytesCount ;
m_pPrntDlg->m_strNumberOfLines = NumberOfLines;
m_pPrntDlg->m_articlesList.InsertItem (m_pPrntDlg->m_icounter, WC(artId));
// update the status control
statusMessage = _T("Getting Article ") ;
statusMessage+= artId;
m_pPrntDlg->m_staticWindow.SetWindowText(statusMessage);
m_pPrntDlg->m_icounter ++;
return !(m_pPrntDlg->m_bisAborted);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.
Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.