| Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
The INNTPOnPost interface defines the interface between event sinks written with CDO and the 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 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 code below 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 "c:\exchsrvr\bin\cdoex.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* EventStatus);
private:
// any other custom methods you wish to use
};
CMyClass::OnPost( IMessage* pMsg, CdoEventStatus* EventStatus)
{
// TODO: add sink code here
}
' References to ADO 2.5 and CDO for Microsoft Exchange Implements CDO.INNTPOnPost Private Sub INNTPOnPost_OnPost( ByVal Msg as CDO.Message, EventStatus as CdoEventStatus ) ' Add sink code here End Sub
<SCRIPT LANGUAGE="VBScript"> Sub INNTPOnPost_OnPost( ByVal Msg, EventStatus) ' Add sink code here End Sub </SCRIPT>