home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue54 / CCorn / SubMain.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-01-10  |  614 b   |  29 lines

  1. unit SubMain;
  2.  
  3. interface
  4.  
  5. uses
  6.   ComObj, ActiveX, Subscriber_TLB, StdVcl, Publisher_TLB;
  7.  
  8. type
  9.   TSubObj = class(TAutoObject, ISubObj, IEventObj)
  10.   protected
  11.     function MyEvent(const EventParam: WideString): HResult; safecall;
  12.     { Protected declarations }
  13.   end;
  14.  
  15. implementation
  16.  
  17. uses ComServ, Windows;
  18.  
  19. function TSubObj.MyEvent(const EventParam: WideString): HResult;
  20. begin
  21.   MessageBox(0, PChar(string(EventParam)), 'COM+ Event!', MB_OK);
  22.   Result := S_OK;
  23. end;
  24.  
  25. initialization
  26.   TAutoObjectFactory.Create(ComServer, TSubObj, Class_SubObj,
  27.     ciMultiInstance, tmApartment);
  28. end.
  29.