| Platform SDK: CDO for Windows 2000 |
The INNTPOnPost interface defines the interface between event sinks written with Microsoft Collaboration Data Objects (CDO) and the Network News Transfer Protocol (NNTP) service OnPost event source.
Method
| Name | Description |
|---|---|
| OnPost | Called by the NNTP event source on bound OnPost event sinks when a message has arrived to the NNTP service. |
To implement an NNTP OnPost event sink using CDO, you create and register a local Component Object Model (COM) class that exposes the CDO INNTPOnPostFinal interface.
For more information on writing NNTP OnPost event sinks, see SMTP/NNTP Transport Event Sinks with CDO.
The following code is an example using the Active Template Library (ATL) to implement an NNTP OnPost event sink.
#include "StdAfx.h"
#include "sinkproj.h" // contains guids for this class
#include "resource.h"
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace
#import <cdosys.dll> raw_interfaces_only no_namespace
class ATL_NO_VTABLE CMyClass :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMyClass,&CLSID_MyClass>,
public IDispatchImpl<INNTPOnPost,&__uuidof(INNTPOnPost),&LIBID_MyClass>
{
public:
CMyClass() {}
DECLARE_REGISTRY_RESOURCEID(IDR_MyClass)
DECLARE_NOT_AGGREGATABLE(CMyClass)
BEGIN_COM_MAP(CMyClass)
COM_INTERFACE_ENTRY(INNTPOnPost)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// INNTPOnPost
public:
STDMETHOD(OnPost) (/* in */ IMessage* pMsg, /* in,out */ CdoEventStatus* pEventStatus);
private:
// any other custom methods you wish to use
};
CMyClass::OnPost( IMessage* pMsg, CdoEventStatus* pEventStatus)
{
// TODO: add sink code here
}
' Reference to Microsoft ActiveX Data Objects 2.5 Library ' Reference to Microsoft CDO for Windows 2000 Library Implements CDO.INNTPOnPost Public Sub INNTPOnPost_OnPost( ByVal Msg as CDO.Message, pEventStatus as CdoEventStatus ) REM Add sink code here End Sub