AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Erstellen eines SMTP transport event sink in Delphi
Thema durchsuchen
Ansicht
Themen-Optionen

Erstellen eines SMTP transport event sink in Delphi

Ein Thema von mkinzler · begonnen am 1. Feb 2007 · letzter Beitrag vom 14. Feb 2007
Antwort Antwort
Seite 2 von 2     12   
Benutzerbild von Remko
Remko

Registriert seit: 10. Okt 2006
Ort: 's-Hertogenbosch, Die Niederlande
222 Beiträge
 
RAD-Studio 2010 Arc
 
#11

Re: Erstellen eines SMTP transport event sink in Delphi

  Alt 14. Feb 2007, 19:33
Might be too late, but I attached a sample for a store event sink, it implements OnSave and OnDelete.
Delphi-Quellcode:
unit DemoEventObject;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  ComObj, ActiveX, MyEventSink_TLB, StdVcl, Exoledb_TLB;

type
  TExchangeEventSinkDemo = class(TAutoObject, IExchangeEventSinkDemo, IExStoreAsyncEvents)
  public
    function OnSave(const pEventInfo: IExStoreEventInfo;
      const bstrURLItem: WideString; lFlags: Integer): HRESULT; stdcall;
    function OnDelete(const pEventInfo: IExStoreEventInfo;
      const bstrURLItem: WideString; lFlags: Integer): HRESULT; stdcall;
  end;

implementation

uses ComServ, SysUtils, Logging, ADODB_TLB;

{ TExchangeEventSinkDemo }

function TExchangeEventSinkDemo.OnDelete(const pEventInfo: IExStoreEventInfo;
  const bstrURLItem: WideString; lFlags: Integer): HRESULT;
begin
  LogMessageToFile('TExchangeEventSinkDemo.OnDelete');
  try
    LogMessageToFile(' Deleted item URL = "'+bstrURLItem+'"');
    LogMessageToFile(' Flags = '+IntToStr(lFlags));
  except
    on Ex: Exception do begin
      LogMessageToFile('Unhandled exception: "'+Ex.Message+'"');
    end;
  end;
  Result := S_OK;
end;

function TExchangeEventSinkDemo.OnSave(const pEventInfo: IExStoreEventInfo;
  const bstrURLItem: WideString; lFlags: Integer): HRESULT;
var
  ADORecord : ADODB_TLB._Record;
  ADOConn : ADODB_TLB.Connection;

begin
  LogMessageToFile('TExchangeEventSinkDemo.OnSave');
  try
    LogMessageToFile(' Saved item URL = "'+bstrURLItem+'"');
    LogMessageToFile(' Flags = '+IntToStr(lFlags));
    { open the item given by the URL with ADO }
    ADOConn := CoConnection.Create();
    ADOConn.Provider := 'Exoledb.DataSource.1';
    ADOConn.Open(bstrURLItem,'','',0);
    ADORecord := CoRecord_.Create();
    ADORecord.Open(bstrURLItem,ADOConn.ConnectionString,
      adModeRead,adFailIfNotExists,adOpenSource,'','');
    LogMessageToFile(' Subject = '+ADORecord.Fields['urn:schemas:mailheader:subject'].Value);
    LogMessageToFile(' From = '+ADORecord.Fields['urn:schemas:mailheader:from'].Value);
    { clean up }
    ADORecord.Close;
    ADOConn.Close;
    LogMessageToFile('Done processing OnSave event');
  except
    on Ex: Exception do begin
      LogMessageToFile('Unhandled exception: "'+Ex.Message+'"');
    end;
  end;
  Result := S_OK;
end;

initialization
  LogMessageToFile('Initializing MyEventSink v1.0');
  TAutoObjectFactory.Create(ComServer, TExchangeEventSinkDemo, Class_ExchangeEventSinkDemo,
    ciMultiInstance, tmNeutral);
  LogMessageToFile('Initialization done');
end.
Delphi-Quellcode:
unit MyEventSink_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : 1.2
// File generated on 3.5.2006 19:17:14 from Type Library described below.

// ************************************************************************ //
// Type Lib: E:\Documents\Magazines\The Delphi Magazine\Exchange Programming\Example Apps\Event Sink Test\MyEventSink.tlb (1)
// LIBID: {8F99DE0D-AE29-4787-A3F0-4BA9996B88EF}
// LCID: 0
// Helpfile:
// HelpString: MyEventSink Library
// DepndLst:
// (1) v2.0 stdole, (C:\WINDOWS\system32\STDOLE2.TLB)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
  

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  MyEventSinkMajorVersion = 1;
  MyEventSinkMinorVersion = 0;

  LIBID_MyEventSink: TGUID = '{8F99DE0D-AE29-4787-A3F0-4BA9996B88EF}';

  IID_IExchangeEventSinkDemo: TGUID = '{908B4257-30B4-4E88-B944-DBB2D085B903}';
  CLASS_ExchangeEventSinkDemo: TGUID = '{D6EEB042-98CD-4707-9A19-2081A6F39AEF}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  IExchangeEventSinkDemo = interface;
  IExchangeEventSinkDemoDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
  ExchangeEventSinkDemo = IExchangeEventSinkDemo;


// *********************************************************************//
// Interface: IExchangeEventSinkDemo
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {908B4257-30B4-4E88-B944-DBB2D085B903}
// *********************************************************************//
  IExchangeEventSinkDemo = interface(IDispatch)
    ['{908B4257-30B4-4E88-B944-DBB2D085B903}']
  end;

// *********************************************************************//
// DispIntf: IExchangeEventSinkDemoDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {908B4257-30B4-4E88-B944-DBB2D085B903}
// *********************************************************************//
  IExchangeEventSinkDemoDisp = dispinterface
    ['{908B4257-30B4-4E88-B944-DBB2D085B903}']
  end;

// *********************************************************************//
// The Class CoExchangeEventSinkDemo provides a Create and CreateRemote method to
// create instances of the default interface IExchangeEventSinkDemo exposed by
// the CoClass ExchangeEventSinkDemo. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoExchangeEventSinkDemo = class
    class function Create: IExchangeEventSinkDemo;
    class function CreateRemote(const MachineName: string): IExchangeEventSinkDemo;
  end;

implementation

uses ComObj;

class function CoExchangeEventSinkDemo.Create: IExchangeEventSinkDemo;
begin
  Result := CreateComObject(CLASS_ExchangeEventSinkDemo) as IExchangeEventSinkDemo;
end;

class function CoExchangeEventSinkDemo.CreateRemote(const MachineName: string): IExchangeEventSinkDemo;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ExchangeEventSinkDemo) as IExchangeEventSinkDemo;
end;

end.
Delphi-Quellcode:
unit Exoledb_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : 1.2
// File generated on 10.4.2006 20:32:51 from Type Library described below.

// ************************************************************************ //
// Type Lib: E:\Documents\Borland Studio Projects\Exchange Events\exoledb.dll (2)
// LIBID: {9DA0E107-86CE-11D1-8699-00C04FB98036}
// LCID: 0
// Helpfile:
// HelpString: EXOLEDB Type Library
// DepndLst:
// (1) v2.0 stdole, (C:\WINDOWS\system32\STDOLE2.TLB)
// Parent TypeLibrary:
// (0) v1.0 MyExchangeEvents, (E:\Documents\Borland Studio Projects\Exchange Events\MyExchangeEvents.tlb)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
  

// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  ExoledbMajorVersion = 1;
  ExoledbMinorVersion = 0;

  LIBID_Exoledb: TGUID = '{9DA0E107-86CE-11D1-8699-00C04FB98036}';

  IID_IExStoreEventInfo: TGUID = '{9DA0E100-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreDispEventInfo: TGUID = '{9DA0E110-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreAsyncEvents: TGUID = '{9DA0E0FE-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreSyncEvents: TGUID = '{9DA0E0FF-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreSystemEvents: TGUID = '{9DA0E101-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreLockEvents: TGUID = '{9DA0E10E-86CE-11D1-8699-00C04FB98036}';
  IID_IGetLockRow: TGUID = '{9DA0E0EF-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreEventLogonInfo: TGUID = '{9DA0E111-86CE-11D1-8699-00C04FB98036}';
  IID_IGetSourceURL: TGUID = '{9DA0E10B-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreEventRegistrationURL: TGUID = '{9DA0E117-86CE-11D1-8699-00C04FB98036}';
  IID_ICreateRegistration: TGUID = '{9DA0E11C-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreNotification: TGUID = '{9DA0E129-86CE-11D1-8699-00C04FB98036}';
  IID_IExStoreRegisterNotification: TGUID = '{9DA0E12A-86CE-11D1-8699-00C04FB98036}';
  IID_IExoledbUrlMapper: TGUID = '{9DA0E11D-86CE-11D1-8699-00C04FB98036}';
  CLASS_ExoledbUrlMapper: TGUID = '{9DA0E11E-86CE-11D1-8699-00C04FB98036}';
  IID_IStoreGuidFromUrl: TGUID = '{9DA0E10C-86CE-11D1-8699-00C04FB98036}';
  CLASS_StoreGuidFromUrl: TGUID = '{9DA0E10D-86CE-11D1-8699-00C04FB98036}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library
// *********************************************************************//
// Constants for enum EVT_SINK_FLAGS
type
  EVT_SINK_FLAGS = TOleEnum;
const
  EVT_NEW_ITEM = $00000001;
  EVT_IS_COLLECTION = $00000002;
  EVT_REPLICATED_ITEM = $00000004;
  EVT_IS_DELIVERED = $00000008;
  EVT_SYNC_BEGIN = $01000000;
  EVT_SYNC_COMMITTED = $02000000;
  EVT_SYNC_ABORTED = $04000000;
  EVT_SOFTDELETE = $00000010;
  EVT_HARDDELETE = $00000020;
  EVT_INITNEW = $00000040;
  EVT_MOVE = $00000100;
  EVT_COPY = $00000200;
  EVT_DRAFT_CREATE = $00000400;
  EVT_DRAFT_SAVE = $00000800;
  EVT_DRAFT_CHECKIN = $00001000;
  EVT_INVALID_SOURCE_URL = $20000000;
  EVT_INVALID_URL = $40000000;
  EVT_ERROR = $80000000;
  EVT_LOCKTYPE_READ = $00010000;
  EVT_LOCKTYPE_WRITE = $00020000;
  EVT_LOCKTYPE_CHECKOUT = $00040000;
  EVT_LOCKTYPE_READWRITE = $00030000;
  EVT_LOCKSCOPE_SHARED = $00080000;
  EVT_LOCKSCOPE_EXCLUSIVE = $00100000;
  EVT_UNLOCK_CHECKIN_ABORT = $00200000;
  EVT_UNLOCK_CHECKIN_KEEP_LOCKED = $00400000;
  EVT_LOCKDEPTH_DEEP = $00800000;
  EVT_LOCK_TRANSIENT = $00002000;
  EVT_VIRUS_CLEANED = $00004000;

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
  IExStoreEventInfo = interface;
  IExStoreDispEventInfo = interface;
  IExStoreDispEventInfoDisp = dispinterface;
  IExStoreAsyncEvents = interface;
  IExStoreSyncEvents = interface;
  IExStoreSystemEvents = interface;
  IExStoreLockEvents = interface;
  IGetLockRow = interface;
  IExStoreEventLogonInfo = interface;
  IGetSourceURL = interface;
  IExStoreEventRegistrationURL = interface;
  IExStoreEventRegistrationURLDisp = dispinterface;
  ICreateRegistration = interface;
  IExStoreNotification = interface;
  IExStoreRegisterNotification = interface;
  IExoledbUrlMapper = interface;
  IExoledbUrlMapperDisp = dispinterface;
  IStoreGuidFromUrl = interface;
  IStoreGuidFromUrlDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
  ExoledbUrlMapper = IExoledbUrlMapper;
  StoreGuidFromUrl = IStoreGuidFromUrl;


// *********************************************************************//
// Declaration of structures, unions and aliases.
// *********************************************************************//
  PUserType1 = ^TGUID; {*}
  PUserType2 = ^_SID; {*}

  LONG_PTR = Integer;

  _SID_IDENTIFIER_AUTHORITY = packed record
    Value: array[0..5] of Byte;
  end;

  _SID = packed record
    Revision: Byte;
    SubAuthorityCount: Byte;
    IdentifierAuthority: _SID_IDENTIFIER_AUTHORITY;
    SubAuthority: ^LongWord;
  end;

  ULONG_PTR = LongWord;

// *********************************************************************//
// Interface: IExStoreEventInfo
// Flags: (0)
// GUID: {9DA0E100-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreEventInfo = interface(IUnknown)
    ['{9DA0E100-86CE-11D1-8699-00C04FB98036}']
    function RemoteGetEventItem(var riid: TGUID; out pdwBindStatus: LongWord;
                                out ppunkEventItem: IUnknown): HResult; stdcall;
    function RemoteGetEventSession(var riid: TGUID; out ppSession: IUnknown): HResult; stdcall;
    function Abort(lErrorCode: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreDispEventInfo
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E110-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreDispEventInfo = interface(IDispatch)
    ['{9DA0E110-86CE-11D1-8699-00C04FB98036}']
    function Get_EventConnection: IDispatch; safecall;
    function Get_EventRecord: IDispatch; safecall;
    procedure AbortChange(lErrorCode: Integer); safecall;
    function Get_SourceURL: WideString; safecall;
    function Get_UserGuid: WideString; safecall;
    function Get_StoreGuid: WideString; safecall;
    function Get_UserSid: OleVariant; safecall;
    function Get_Data: LONG_PTR; safecall;
    procedure Set_Data(plData: LONG_PTR); safecall;
    property EventConnection: IDispatch read Get_EventConnection;
    property EventRecord: IDispatch read Get_EventRecord;
    property SourceURL: WideString read Get_SourceURL;
    property UserGuid: WideString read Get_UserGuid;
    property StoreGuid: WideString read Get_StoreGuid;
    property UserSid: OleVariant read Get_UserSid;
    property Data: LONG_PTR read Get_Data write Set_Data;
  end;

// *********************************************************************//
// DispIntf: IExStoreDispEventInfoDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E110-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreDispEventInfoDisp = dispinterface
    ['{9DA0E110-86CE-11D1-8699-00C04FB98036}']
    property EventConnection: IDispatch readonly dispid 1610743808;
    property EventRecord: IDispatch readonly dispid 1610743809;
    procedure AbortChange(lErrorCode: Integer); dispid 1610743810;
    property SourceURL: WideString readonly dispid 1610743811;
    property UserGuid: WideString readonly dispid 1610743812;
    property StoreGuid: WideString readonly dispid 1610743813;
    property UserSid: OleVariant readonly dispid 1610743814;
    property Data: LONG_PTR dispid 1610743815;
  end;

// *********************************************************************//
// Interface: IExStoreAsyncEvents
// Flags: (0)
// GUID: {9DA0E0FE-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreAsyncEvents = interface(IUnknown)
    ['{9DA0E0FE-86CE-11D1-8699-00C04FB98036}']
    function OnSave(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                    lFlags: Integer): HResult; stdcall;
    function OnDelete(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                      lFlags: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreSyncEvents
// Flags: (0)
// GUID: {9DA0E0FF-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreSyncEvents = interface(IUnknown)
    ['{9DA0E0FF-86CE-11D1-8699-00C04FB98036}']
    function OnSyncSave(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                        lFlags: Integer): HResult; stdcall;
    function OnSyncDelete(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                          lFlags: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreSystemEvents
// Flags: (0)
// GUID: {9DA0E101-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreSystemEvents = interface(IUnknown)
    ['{9DA0E101-86CE-11D1-8699-00C04FB98036}']
    function OnTimer(const bstrURLItem: WideString; lFlags: Integer): HResult; stdcall;
    function OnMDBStartUp(const bstrMDBGuid: WideString; const bstrMDBName: WideString;
                          lFlags: Integer): HResult; stdcall;
    function OnMDBShutDown(const bstrMDBGuid: WideString; lFlags: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreLockEvents
// Flags: (0)
// GUID: {9DA0E10E-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreLockEvents = interface(IUnknown)
    ['{9DA0E10E-86CE-11D1-8699-00C04FB98036}']
    function OnSyncLock(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                        lFlags: Integer): HResult; stdcall;
    function OnSyncUnlock(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                          lFlags: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IGetLockRow
// Flags: (0)
// GUID: {9DA0E0EF-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IGetLockRow = interface(IUnknown)
    ['{9DA0E0EF-86CE-11D1-8699-00C04FB98036}']
    function GetLockRow(var riid: TGUID; out pdwBindStatus: LongWord; out ppunkLockRow: IUnknown): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreEventLogonInfo
// Flags: (0)
// GUID: {9DA0E111-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreEventLogonInfo = interface(IUnknown)
    ['{9DA0E111-86CE-11D1-8699-00C04FB98036}']
    function GetUserGuid(var pguid: TGUID): HResult; stdcall;
    function GetStoreGuid(var pguid: TGUID): HResult; stdcall;
    function GetUserSid(out ppsid: PUserType2): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IGetSourceURL
// Flags: (0)
// GUID: {9DA0E10B-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IGetSourceURL = interface(IUnknown)
    ['{9DA0E10B-86CE-11D1-8699-00C04FB98036}']
    function GetSourceURL(out pbstrURL: WideString): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreEventRegistrationURL
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E117-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreEventRegistrationURL = interface(IDispatch)
    ['{9DA0E117-86CE-11D1-8699-00C04FB98036}']
    function Get_EventRegistrationURL: WideString; safecall;
    property EventRegistrationURL: WideString read Get_EventRegistrationURL;
  end;

// *********************************************************************//
// DispIntf: IExStoreEventRegistrationURLDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E117-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreEventRegistrationURLDisp = dispinterface
    ['{9DA0E117-86CE-11D1-8699-00C04FB98036}']
    property EventRegistrationURL: WideString readonly dispid 1610743808;
  end;

// *********************************************************************//
// Interface: ICreateRegistration
// Flags: (0)
// GUID: {9DA0E11C-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  ICreateRegistration = interface(IUnknown)
    ['{9DA0E11C-86CE-11D1-8699-00C04FB98036}']
    function Register(const pEventInfo: IExStoreEventInfo; const bstrURLItem: WideString;
                      lFlags: Integer; out phr: Integer): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreNotification
// Flags: (0)
// GUID: {9DA0E129-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreNotification = interface(IUnknown)
    ['{9DA0E129-86CE-11D1-8699-00C04FB98036}']
    function OnChange(dwHandle: ULONG_PTR; dwFlags: LongWord): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExStoreRegisterNotification
// Flags: (0)
// GUID: {9DA0E12A-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExStoreRegisterNotification = interface(IUnknown)
    ['{9DA0E12A-86CE-11D1-8699-00C04FB98036}']
    function Register(const bstrURL: WideString; const pSink: IExStoreNotification;
                      dwFlags: LongWord; out pdwHandle: ULONG_PTR): HResult; stdcall;
    function UnRegister(dwHandle: ULONG_PTR): HResult; stdcall;
    function Ready(dwHandle: ULONG_PTR; out pdwRemaining: LongWord): HResult; stdcall;
  end;

// *********************************************************************//
// Interface: IExoledbUrlMapper
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E11D-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExoledbUrlMapper = interface(IDispatch)
    ['{9DA0E11D-86CE-11D1-8699-00C04FB98036}']
    function HttpUrlToFilePath(const bstrHttpUrl: WideString): WideString; safecall;
    function FilePathToHttpUrls(const bstrFilePath: WideString): PSafeArray; safecall;
    function FilePathToExoledbFileUrl(const bstrFilePath: WideString): WideString; safecall;
    function ExoledbFileUrlToFilePath(const bstrExoledbFileUrl: WideString): WideString; safecall;
  end;

// *********************************************************************//
// DispIntf: IExoledbUrlMapperDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E11D-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IExoledbUrlMapperDisp = dispinterface
    ['{9DA0E11D-86CE-11D1-8699-00C04FB98036}']
    function HttpUrlToFilePath(const bstrHttpUrl: WideString): WideString; dispid 1610743808;
    function FilePathToHttpUrls(const bstrFilePath: WideString): {??PSafeArray}OleVariant; dispid 1610743809;
    function FilePathToExoledbFileUrl(const bstrFilePath: WideString): WideString; dispid 1610743810;
    function ExoledbFileUrlToFilePath(const bstrExoledbFileUrl: WideString): WideString; dispid 1610743811;
  end;

// *********************************************************************//
// Interface: IStoreGuidFromUrl
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E10C-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IStoreGuidFromUrl = interface(IDispatch)
    ['{9DA0E10C-86CE-11D1-8699-00C04FB98036}']
    function StoreGuidFromUrl(const bstrURL: WideString): WideString; safecall;
  end;

// *********************************************************************//
// DispIntf: IStoreGuidFromUrlDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {9DA0E10C-86CE-11D1-8699-00C04FB98036}
// *********************************************************************//
  IStoreGuidFromUrlDisp = dispinterface
    ['{9DA0E10C-86CE-11D1-8699-00C04FB98036}']
    function StoreGuidFromUrl(const bstrURL: WideString): WideString; dispid 1610743808;
  end;

// *********************************************************************//
// The Class CoExoledbUrlMapper provides a Create and CreateRemote method to
// create instances of the default interface IExoledbUrlMapper exposed by
// the CoClass ExoledbUrlMapper. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoExoledbUrlMapper = class
    class function Create: IExoledbUrlMapper;
    class function CreateRemote(const MachineName: string): IExoledbUrlMapper;
  end;

// *********************************************************************//
// The Class CoStoreGuidFromUrl provides a Create and CreateRemote method to
// create instances of the default interface IStoreGuidFromUrl exposed by
// the CoClass StoreGuidFromUrl. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
  CoStoreGuidFromUrl = class
    class function Create: IStoreGuidFromUrl;
    class function CreateRemote(const MachineName: string): IStoreGuidFromUrl;
  end;

implementation

uses ComObj;

class function CoExoledbUrlMapper.Create: IExoledbUrlMapper;
begin
  Result := CreateComObject(CLASS_ExoledbUrlMapper) as IExoledbUrlMapper;
end;

class function CoExoledbUrlMapper.CreateRemote(const MachineName: string): IExoledbUrlMapper;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ExoledbUrlMapper) as IExoledbUrlMapper;
end;

class function CoStoreGuidFromUrl.Create: IStoreGuidFromUrl;
begin
  Result := CreateComObject(CLASS_StoreGuidFromUrl) as IStoreGuidFromUrl;
end;

class function CoStoreGuidFromUrl.CreateRemote(const MachineName: string): IStoreGuidFromUrl;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_StoreGuidFromUrl) as IStoreGuidFromUrl;
end;

end.
Angehängte Dateien
Dateityp: zip event_sink_test_535.zip (23,4 KB, 17x aufgerufen)
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
 
Delphi 11 Alexandria
 
#12

Re: Erstellen eines SMTP transport event sink in Delphi

  Alt 14. Feb 2007, 19:38
Thanks Remoko, I will have look on it.
Markus Kinzler
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz