다음을 통해 공유


INNTPOnPost Interface

Topic Last Modified: 2006-06-13

The INNTPOnPost interface defines the interface between event sinks written with Collaboration Data Objects (CDO) and the Network News Transfer Protocol (NNTP) service OnPost event source.

CLSID

CD000027-8B95-11D1-82DB-00C04FB1625D

Extends

IDispatch

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Member Summary

The following table lists the methods of the INNTPOnPost interface.

Name Description

OnPost

Called by the NNTP event source on bound OnPost event sinks when a message has arrived to the NNTP service.

Remarks

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 about writing NNTP OnPost event sinks, see SMTP/NNTP Transport Event Sinks with CDO.

Examples

[C++]

#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:\program files\common files\microsoft shared\cdo\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
}

[Visual Basic]

' 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

[VBScript]

<SCRIPT LANGUAGE="VBScript">
Sub INNTPOnPost_OnPost( ByVal Msg, EventStatus)
  ' Add sink code here
End Sub
</SCRIPT>