Platform SDK: CDO for Windows 2000 |
The INNTPOnPostEarly interface defines the interface between event sinks written with Microsoft Collaboration Data Objects for Windows 2000 (CDOSYS) and the Network News Transfer Protocol (NNTP) service OnPostEarly event dispatcher.
Method
Name | Description |
---|---|
OnPostEarly | Called by the NNTP event source on registered OnPostEarly event sinks when message or news feed headers arrive to the NNTP service but before the message content has arrived. |
To implement an NNTP OnPostEarly event sink using CDO, you create and register a COM class that exposes the CDO INNTPOnPostEarly interface.
For more information on implementing NNTP OnPostEarly event sinks, see SMTP/NNTP Transport Event Sinks with CDO.
The following code below is an example of how to use the Active Template Library (ATL) to implement an NNTP OnPostEarly 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<INNTPOnPostEarly,&__uuidof(INNTPOnPostEarly),&LIBID_MyClass> { public: CMyClass() {} DECLARE_REGISTRY_RESOURCEID(IDR_MyClass) DECLARE_NOT_AGGREGATABLE(CMyClass) BEGIN_COM_MAP(CMyClass) COM_INTERFACE_ENTRY(INNTPOnPostEarly) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() // INNTPOnPostEarly public: STDMETHOD(OnPostEarly) (/* in */ IMessage* pMsg, /* in,out */ CdoEventStatus* pEventStatus); private: // any other custom methods you wish to use }; CMyClass.OnPostEarly( 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.INNTPOnPostEarly Public Sub INNTPOnPostEarly_OnPostEarly( ByVal Msg as IMessage, pEventStatus as CdoEventStatus ) REM Add handling code here End Sub