Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

SystemMonitor_TLB for Delphi 2009 Win32

By: a guest on Aug 5th, 2012  |  syntax: Delphi  |  size: 47.62 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. unit SystemMonitor_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                    
  5. // -------                                                                    
  6. // The types declared in this file were generated from data read from a      
  7. // Type Library. If this type library is explicitly or indirectly (via        
  8. // another type library referring to this type library) re-imported, or the  
  9. // 'Refresh' command of the Type Library Editor activated while editing the  
  10. // Type Library, the contents of this file will be regenerated and all        
  11. // manual modifications will be lost.                                        
  12. // ************************************************************************ //
  13.  
  14. // $Rev: 16059 $
  15. // File generated on 8/6/2012 7:52:35 from Type Library described below.
  16.  
  17. // ************************************************************************  //
  18. // Type Lib: C:\WINDOWS\SYSTEM32\sysmon.ocx (1)
  19. // LIBID: {1B773E42-2509-11CF-942F-008029004347}
  20. // LCID: 0
  21. // Helpfile:
  22. // HelpString: System Monitor Control
  23. // DepndLst:
  24. //   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
  25. // Errors:
  26. //   Hint: TypeInfo 'SystemMonitor' changed to 'SystemMonitor_'
  27. //   Error creating palette bitmap of (TSystemMonitor_) : Registry key CLSID\{C4D2D8E0-D1DD-11CE-940F-008029004347}\ToolboxBitmap32 not found
  28. // ************************************************************************ //
  29. // *************************************************************************//
  30. // NOTE:                                                                      
  31. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
  32. // which return objects that may need to be explicitly created via a function
  33. // call prior to any access via the property. These items have been disabled  
  34. // in order to prevent accidental use from within the object inspector. You  
  35. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively  
  36. // removing them from the $IFDEF blocks. However, such items must still be    
  37. // programmatically created via a method of the appropriate CoClass before    
  38. // they can be used.                                                          
  39. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  40. {$WARN SYMBOL_PLATFORM OFF}
  41. {$WRITEABLECONST ON}
  42. {$VARPROPSETTER ON}
  43. {$ALIGN 4}
  44. interface
  45.  
  46. uses Windows, ActiveX, Classes, Graphics, OleCtrls, OleServer, StdVCL, Variants;
  47.  
  48.  
  49.  
  50. // *********************************************************************//
  51. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  52. //   Type Libraries     : LIBID_xxxx                                      
  53. //   CoClasses          : CLASS_xxxx                                      
  54. //   DISPInterfaces     : DIID_xxxx                                      
  55. //   Non-DISP interfaces: IID_xxxx                                        
  56. // *********************************************************************//
  57. const
  58.   // TypeLibrary Major and minor versions
  59.   SystemMonitorMajorVersion = 3;
  60.   SystemMonitorMinorVersion = 6;
  61.  
  62.   LIBID_SystemMonitor: TGUID = '{1B773E42-2509-11CF-942F-008029004347}';
  63.  
  64.   IID_ICounterItem: TGUID = '{771A9520-EE28-11CE-941E-008029004347}';
  65.   DIID_DICounterItem: TGUID = '{C08C4FF2-0E2E-11CF-942C-008029004347}';
  66.   IID_ICounters: TGUID = '{79167962-28FC-11CF-942F-008029004347}';
  67.   IID_ILogFileItem: TGUID = '{D6B518DD-05C7-418A-89E6-4F9CE8C6841E}';
  68.   DIID_DILogFileItem: TGUID = '{8D093FFC-F777-4917-82D1-833FBC54C58F}';
  69.   IID_ILogFiles: TGUID = '{6A2A97E6-6851-41EA-87AD-2A8225335865}';
  70.   IID_ISystemMonitor: TGUID = '{194EB241-C32C-11CF-9398-00AA00A3DDEA}';
  71.   DIID_DISystemMonitorInternal: TGUID = '{194EB242-C32C-11CF-9398-00AA00A3DDEA}';
  72.   DIID_DISystemMonitor: TGUID = '{13D73D81-C32E-11CF-9398-00AA00A3DDEA}';
  73.   IID_ISystemMonitorEvents: TGUID = '{EE660EA0-4ABD-11CF-943A-008029004347}';
  74.   DIID_DISystemMonitorEvents: TGUID = '{84979930-4AB3-11CF-943A-008029004347}';
  75.   CLASS_SystemMonitor_: TGUID = '{C4D2D8E0-D1DD-11CE-940F-008029004347}';
  76.   CLASS_CounterItem: TGUID = '{C4D2D8E0-D1DD-11CE-940F-008029004348}';
  77.   CLASS_Counters: TGUID = '{B2B066D2-2AAC-11CF-942F-008029004347}';
  78.   CLASS_LogFileItem: TGUID = '{16EC5BE8-DF93-4237-94E4-9EE918111D71}';
  79.   CLASS_LogFiles: TGUID = '{2735D9FD-F6B9-4F19-A5D9-E2D068584BC5}';
  80.  
  81. // *********************************************************************//
  82. // Declaration of Enumerations defined in Type Library                    
  83. // *********************************************************************//
  84. // Constants for enum DisplayTypeConstants
  85. type
  86.   DisplayTypeConstants = TOleEnum;
  87. const
  88.   sysmonLineGraph = $00000001;
  89.   sysmonHistogram = $00000002;
  90.   sysmonReport = $00000003;
  91.  
  92. // Constants for enum ReportValueTypeConstants
  93. type
  94.   ReportValueTypeConstants = TOleEnum;
  95. const
  96.   sysmonDefaultValue = $00000000;
  97.   sysmonCurrentValue = $00000001;
  98.   sysmonAverage = $00000002;
  99.   sysmonMinimum = $00000003;
  100.   sysmonMaximum = $00000004;
  101.  
  102. // Constants for enum DataSourceTypeConstants
  103. type
  104.   DataSourceTypeConstants = TOleEnum;
  105. const
  106.   sysmonNullDataSource = $FFFFFFFF;
  107.   sysmonCurrentActivity = $00000001;
  108.   sysmonLogFiles = $00000002;
  109.   sysmonSqlLog = $00000003;
  110.  
  111. type
  112.  
  113. // *********************************************************************//
  114. // Forward declaration of types defined in TypeLibrary                    
  115. // *********************************************************************//
  116.   ICounterItem = interface;
  117.   DICounterItem = dispinterface;
  118.   ICounters = interface;
  119.   ICountersDisp = dispinterface;
  120.   ILogFileItem = interface;
  121.   DILogFileItem = dispinterface;
  122.   ILogFiles = interface;
  123.   ILogFilesDisp = dispinterface;
  124.   ISystemMonitor = interface;
  125.   DISystemMonitorInternal = dispinterface;
  126.   DISystemMonitor = dispinterface;
  127.   ISystemMonitorEvents = interface;
  128.   DISystemMonitorEvents = dispinterface;
  129.  
  130. // *********************************************************************//
  131. // Declaration of CoClasses defined in Type Library                      
  132. // (NOTE: Here we map each CoClass to its Default Interface)              
  133. // *********************************************************************//
  134.   SystemMonitor_ = DISystemMonitor;
  135.   CounterItem = DICounterItem;
  136.   Counters = ICounters;
  137.   LogFileItem = DILogFileItem;
  138.   LogFiles = ILogFiles;
  139.  
  140.  
  141. // *********************************************************************//
  142. // Declaration of structures, unions and aliases.                        
  143. // *********************************************************************//
  144.   PUserType1 = ^TGUID; {*}
  145.  
  146.  
  147. // *********************************************************************//
  148. // Interface: ICounterItem
  149. // Flags:     (16) Hidden
  150. // GUID:      {771A9520-EE28-11CE-941E-008029004347}
  151. // *********************************************************************//
  152.   ICounterItem = interface(IUnknown)
  153.     ['{771A9520-EE28-11CE-941E-008029004347}']
  154.     function Get_Value(out pdblValue: Double): HResult; stdcall;
  155.     function Set_Color(pColor: OLE_COLOR): HResult; stdcall;
  156.     function Get_Color(out pColor: OLE_COLOR): HResult; stdcall;
  157.     function Set_Width(piValue: SYSINT): HResult; stdcall;
  158.     function Get_Width(out piValue: SYSINT): HResult; stdcall;
  159.     function Set_LineStyle(piValue: SYSINT): HResult; stdcall;
  160.     function Get_LineStyle(out piValue: SYSINT): HResult; stdcall;
  161.     function Set_ScaleFactor(piValue: SYSINT): HResult; stdcall;
  162.     function Get_ScaleFactor(out piValue: SYSINT): HResult; stdcall;
  163.     function Get_Path(out pstrValue: WideString): HResult; stdcall;
  164.     function GetValue(out Value: Double; out Status: Integer): HResult; stdcall;
  165.     function GetStatistics(out Max: Double; out Min: Double; out Avg: Double; out Status: Integer): HResult; stdcall;
  166.   end;
  167.  
  168. // *********************************************************************//
  169. // DispIntf:  DICounterItem
  170. // Flags:     (4112) Hidden Dispatchable
  171. // GUID:      {C08C4FF2-0E2E-11CF-942C-008029004347}
  172. // *********************************************************************//
  173.   DICounterItem = dispinterface
  174.     ['{C08C4FF2-0E2E-11CF-942C-008029004347}']
  175.     property Value: Double readonly dispid 0;
  176.     property Color: OLE_COLOR dispid 1;
  177.     property Width: SYSINT dispid 2;
  178.     property LineStyle: SYSINT dispid 3;
  179.     property ScaleFactor: SYSINT dispid 4;
  180.     property Path: WideString readonly dispid 5;
  181.     procedure GetValue(out Value: Double; out Status: Integer); dispid 1610678282;
  182.     procedure GetStatistics(out Max: Double; out Min: Double; out Avg: Double; out Status: Integer); dispid 1610678283;
  183.   end;
  184.  
  185. // *********************************************************************//
  186. // Interface: ICounters
  187. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  188. // GUID:      {79167962-28FC-11CF-942F-008029004347}
  189. // *********************************************************************//
  190.   ICounters = interface(IDispatch)
  191.     ['{79167962-28FC-11CF-942F-008029004347}']
  192.     function Get_Count: Integer; safecall;
  193.     function Get__NewEnum: IUnknown; safecall;
  194.     function Get_Item(index: OleVariant): DICounterItem; safecall;
  195.     function Add(const pathname: WideString): DICounterItem; safecall;
  196.     procedure Remove(index: OleVariant); safecall;
  197.     property Count: Integer read Get_Count;
  198.     property _NewEnum: IUnknown read Get__NewEnum;
  199.     property Item[index: OleVariant]: DICounterItem read Get_Item; default;
  200.   end;
  201.  
  202. // *********************************************************************//
  203. // DispIntf:  ICountersDisp
  204. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  205. // GUID:      {79167962-28FC-11CF-942F-008029004347}
  206. // *********************************************************************//
  207.   ICountersDisp = dispinterface
  208.     ['{79167962-28FC-11CF-942F-008029004347}']
  209.     property Count: Integer readonly dispid 1610743808;
  210.     property _NewEnum: IUnknown readonly dispid -4;
  211.     property Item[index: OleVariant]: DICounterItem readonly dispid 0; default;
  212.     function Add(const pathname: WideString): DICounterItem; dispid 1610743811;
  213.     procedure Remove(index: OleVariant); dispid 1610743812;
  214.   end;
  215.  
  216. // *********************************************************************//
  217. // Interface: ILogFileItem
  218. // Flags:     (16) Hidden
  219. // GUID:      {D6B518DD-05C7-418A-89E6-4F9CE8C6841E}
  220. // *********************************************************************//
  221.   ILogFileItem = interface(IUnknown)
  222.     ['{D6B518DD-05C7-418A-89E6-4F9CE8C6841E}']
  223.     function Get_Path(out pstrValue: WideString): HResult; stdcall;
  224.   end;
  225.  
  226. // *********************************************************************//
  227. // DispIntf:  DILogFileItem
  228. // Flags:     (4112) Hidden Dispatchable
  229. // GUID:      {8D093FFC-F777-4917-82D1-833FBC54C58F}
  230. // *********************************************************************//
  231.   DILogFileItem = dispinterface
  232.     ['{8D093FFC-F777-4917-82D1-833FBC54C58F}']
  233.     property Path: WideString readonly dispid 0;
  234.   end;
  235.  
  236. // *********************************************************************//
  237. // Interface: ILogFiles
  238. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  239. // GUID:      {6A2A97E6-6851-41EA-87AD-2A8225335865}
  240. // *********************************************************************//
  241.   ILogFiles = interface(IDispatch)
  242.     ['{6A2A97E6-6851-41EA-87AD-2A8225335865}']
  243.     function Get_Count: Integer; safecall;
  244.     function Get__NewEnum: IUnknown; safecall;
  245.     function Get_Item(index: OleVariant): DILogFileItem; safecall;
  246.     function Add(const pathname: WideString): DILogFileItem; safecall;
  247.     procedure Remove(index: OleVariant); safecall;
  248.     property Count: Integer read Get_Count;
  249.     property _NewEnum: IUnknown read Get__NewEnum;
  250.     property Item[index: OleVariant]: DILogFileItem read Get_Item; default;
  251.   end;
  252.  
  253. // *********************************************************************//
  254. // DispIntf:  ILogFilesDisp
  255. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  256. // GUID:      {6A2A97E6-6851-41EA-87AD-2A8225335865}
  257. // *********************************************************************//
  258.   ILogFilesDisp = dispinterface
  259.     ['{6A2A97E6-6851-41EA-87AD-2A8225335865}']
  260.     property Count: Integer readonly dispid 1610743808;
  261.     property _NewEnum: IUnknown readonly dispid -4;
  262.     property Item[index: OleVariant]: DILogFileItem readonly dispid 0; default;
  263.     function Add(const pathname: WideString): DILogFileItem; dispid 1610743811;
  264.     procedure Remove(index: OleVariant); dispid 1610743812;
  265.   end;
  266.  
  267. // *********************************************************************//
  268. // Interface: ISystemMonitor
  269. // Flags:     (16) Hidden
  270. // GUID:      {194EB241-C32C-11CF-9398-00AA00A3DDEA}
  271. // *********************************************************************//
  272.   ISystemMonitor = interface(IUnknown)
  273.     ['{194EB241-C32C-11CF-9398-00AA00A3DDEA}']
  274.     function Get_Appearance(out iAppearance: SYSINT): HResult; stdcall;
  275.     function Set_Appearance(iAppearance: SYSINT): HResult; stdcall;
  276.     function Get_BackColor(out pColor: OLE_COLOR): HResult; stdcall;
  277.     function Set_BackColor(pColor: OLE_COLOR): HResult; stdcall;
  278.     function Get_BorderStyle(out iBorderStyle: SYSINT): HResult; stdcall;
  279.     function Set_BorderStyle(iBorderStyle: SYSINT): HResult; stdcall;
  280.     function Get_ForeColor(out pColor: OLE_COLOR): HResult; stdcall;
  281.     function Set_ForeColor(pColor: OLE_COLOR): HResult; stdcall;
  282.     function Get_Font(out ppFont: IFontDisp): HResult; stdcall;
  283.     function _Set_Font(const ppFont: IFontDisp): HResult; stdcall;
  284.     function Get_Counters(out ppICounters: ICounters): HResult; stdcall;
  285.     function Set_ShowVerticalGrid(pbState: WordBool): HResult; stdcall;
  286.     function Get_ShowVerticalGrid(out pbState: WordBool): HResult; stdcall;
  287.     function Set_ShowHorizontalGrid(pbState: WordBool): HResult; stdcall;
  288.     function Get_ShowHorizontalGrid(out pbState: WordBool): HResult; stdcall;
  289.     function Set_ShowLegend(pbState: WordBool): HResult; stdcall;
  290.     function Get_ShowLegend(out pbState: WordBool): HResult; stdcall;
  291.     function Set_ShowScaleLabels(pbState: WordBool): HResult; stdcall;
  292.     function Get_ShowScaleLabels(out pbState: WordBool): HResult; stdcall;
  293.     function Set_ShowValueBar(pbState: WordBool): HResult; stdcall;
  294.     function Get_ShowValueBar(out pbState: WordBool): HResult; stdcall;
  295.     function Set_MaximumScale(piValue: SYSINT): HResult; stdcall;
  296.     function Get_MaximumScale(out piValue: SYSINT): HResult; stdcall;
  297.     function Set_MinimumScale(piValue: SYSINT): HResult; stdcall;
  298.     function Get_MinimumScale(out piValue: SYSINT): HResult; stdcall;
  299.     function Set_UpdateInterval(pfValue: Single): HResult; stdcall;
  300.     function Get_UpdateInterval(out pfValue: Single): HResult; stdcall;
  301.     function Set_DisplayType(peDisplayType: DisplayTypeConstants): HResult; stdcall;
  302.     function Get_DisplayType(out peDisplayType: DisplayTypeConstants): HResult; stdcall;
  303.     function Set_ManualUpdate(pbState: WordBool): HResult; stdcall;
  304.     function Get_ManualUpdate(out pbState: WordBool): HResult; stdcall;
  305.     function Set_GraphTitle(const pbsTitle: WideString): HResult; stdcall;
  306.     function Get_GraphTitle(out pbsTitle: WideString): HResult; stdcall;
  307.     function Set_YAxisLabel(const pbsTitle: WideString): HResult; stdcall;
  308.     function Get_YAxisLabel(out pbsTitle: WideString): HResult; stdcall;
  309.     function CollectSample: HResult; stdcall;
  310.     function UpdateGraph: HResult; stdcall;
  311.     function BrowseCounters: HResult; stdcall;
  312.     function DisplayProperties: HResult; stdcall;
  313.     function Counter(iIndex: SYSINT; out ppICounter: ICounterItem): HResult; stdcall;
  314.     function AddCounter(const bsPath: WideString; out ppICounter: ICounterItem): HResult; stdcall;
  315.     function DeleteCounter(const pCtr: ICounterItem): HResult; stdcall;
  316.     function Get_BackColorCtl(out pColor: OLE_COLOR): HResult; stdcall;
  317.     function Set_BackColorCtl(pColor: OLE_COLOR): HResult; stdcall;
  318.     function Set_LogFileName(const bsFileName: WideString): HResult; stdcall;
  319.     function Get_LogFileName(out bsFileName: WideString): HResult; stdcall;
  320.     function Set_LogViewStart(StartTime: TDateTime): HResult; stdcall;
  321.     function Get_LogViewStart(out StartTime: TDateTime): HResult; stdcall;
  322.     function Set_LogViewStop(StopTime: TDateTime): HResult; stdcall;
  323.     function Get_LogViewStop(out StopTime: TDateTime): HResult; stdcall;
  324.     function Get_GridColor(out pColor: OLE_COLOR): HResult; stdcall;
  325.     function Set_GridColor(pColor: OLE_COLOR): HResult; stdcall;
  326.     function Get_TimeBarColor(out pColor: OLE_COLOR): HResult; stdcall;
  327.     function Set_TimeBarColor(pColor: OLE_COLOR): HResult; stdcall;
  328.     function Get_Highlight(out pbState: WordBool): HResult; stdcall;
  329.     function Set_Highlight(pbState: WordBool): HResult; stdcall;
  330.     function Get_ShowToolbar(out pbState: WordBool): HResult; stdcall;
  331.     function Set_ShowToolbar(pbState: WordBool): HResult; stdcall;
  332.     function Paste: HResult; stdcall;
  333.     function Copy: HResult; stdcall;
  334.     function Reset: HResult; stdcall;
  335.     function Set_ReadOnly(pbState: WordBool): HResult; stdcall;
  336.     function Get_ReadOnly(out pbState: WordBool): HResult; stdcall;
  337.     function Set_ReportValueType(peReportValueType: ReportValueTypeConstants): HResult; stdcall;
  338.     function Get_ReportValueType(out peReportValueType: ReportValueTypeConstants): HResult; stdcall;
  339.     function Set_MonitorDuplicateInstances(pbState: WordBool): HResult; stdcall;
  340.     function Get_MonitorDuplicateInstances(out pbState: WordBool): HResult; stdcall;
  341.     function Set_DisplayFilter(piValue: SYSINT): HResult; stdcall;
  342.     function Get_DisplayFilter(out piValue: SYSINT): HResult; stdcall;
  343.     function Get_LogFiles(out ppILogFiles: ILogFiles): HResult; stdcall;
  344.     function Set_DataSourceType(peDataSourceType: DataSourceTypeConstants): HResult; stdcall;
  345.     function Get_DataSourceType(out peDataSourceType: DataSourceTypeConstants): HResult; stdcall;
  346.     function Set_SqlDsnName(const bsSqlDsnName: WideString): HResult; stdcall;
  347.     function Get_SqlDsnName(out bsSqlDsnName: WideString): HResult; stdcall;
  348.     function Set_SqlLogSetName(const bsSqlLogSetName: WideString): HResult; stdcall;
  349.     function Get_SqlLogSetName(out bsSqlLogSetName: WideString): HResult; stdcall;
  350.   end;
  351.  
  352. // *********************************************************************//
  353. // DispIntf:  DISystemMonitorInternal
  354. // Flags:     (4112) Hidden Dispatchable
  355. // GUID:      {194EB242-C32C-11CF-9398-00AA00A3DDEA}
  356. // *********************************************************************//
  357.   DISystemMonitorInternal = dispinterface
  358.     ['{194EB242-C32C-11CF-9398-00AA00A3DDEA}']
  359.     property Appearance: SYSINT dispid -520;
  360.     property BackColor: OLE_COLOR dispid -501;
  361.     property BorderStyle: SYSINT dispid -504;
  362.     property ForeColor: OLE_COLOR dispid -513;
  363.     property Font: IFontDisp dispid -512;
  364.     property Counters: ICounters readonly dispid 0;
  365.     property ShowVerticalGrid: WordBool dispid 1;
  366.     property ShowHorizontalGrid: WordBool dispid 2;
  367.     property ShowLegend: WordBool dispid 3;
  368.     property ShowScaleLabels: WordBool dispid 4;
  369.     property ShowValueBar: WordBool dispid 5;
  370.     property MaximumScale: SYSINT dispid 6;
  371.     property MinimumScale: SYSINT dispid 7;
  372.     property UpdateInterval: Single dispid 8;
  373.     property DisplayType: DisplayTypeConstants dispid 9;
  374.     property ManualUpdate: WordBool dispid 16;
  375.     property GraphTitle: WideString dispid 17;
  376.     property YAxisLabel: WideString dispid 18;
  377.     procedure CollectSample; dispid 20;
  378.     procedure UpdateGraph; dispid 21;
  379.     procedure BrowseCounters; dispid 22;
  380.     procedure DisplayProperties; dispid 23;
  381.     procedure Counter(iIndex: SYSINT; out ppICounter: ICounterItem); dispid 24;
  382.     procedure AddCounter(const bsPath: WideString; out ppICounter: ICounterItem); dispid 25;
  383.     procedure DeleteCounter(const pCtr: ICounterItem); dispid 32;
  384.     property BackColorCtl: OLE_COLOR dispid 33;
  385.     property LogFileName: WideString dispid 34;
  386.     property LogViewStart: TDateTime dispid 35;
  387.     property LogViewStop: TDateTime dispid 36;
  388.     property GridColor: OLE_COLOR dispid 37;
  389.     property TimeBarColor: OLE_COLOR dispid 38;
  390.     property Highlight: WordBool dispid 39;
  391.     property ShowToolbar: WordBool dispid 40;
  392.     procedure Paste; dispid 41;
  393.     procedure Copy; dispid 48;
  394.     procedure Reset; dispid 49;
  395.     property ReadOnly: WordBool dispid 50;
  396.     property ReportValueType: ReportValueTypeConstants dispid 51;
  397.     property MonitorDuplicateInstances: WordBool dispid 52;
  398.     property DisplayFilter: SYSINT dispid 53;
  399.     property LogFiles: ILogFiles readonly dispid 54;
  400.     property DataSourceType: DataSourceTypeConstants dispid 55;
  401.     property SqlDsnName: WideString dispid 56;
  402.     property SqlLogSetName: WideString dispid 57;
  403.   end;
  404.  
  405. // *********************************************************************//
  406. // DispIntf:  DISystemMonitor
  407. // Flags:     (4112) Hidden Dispatchable
  408. // GUID:      {13D73D81-C32E-11CF-9398-00AA00A3DDEA}
  409. // *********************************************************************//
  410.   DISystemMonitor = dispinterface
  411.     ['{13D73D81-C32E-11CF-9398-00AA00A3DDEA}']
  412.     procedure Reset; dispid 49;
  413.     procedure Copy; dispid 48;
  414.     procedure Paste; dispid 41;
  415.     procedure DisplayProperties; dispid 23;
  416.     procedure BrowseCounters; dispid 22;
  417.     procedure UpdateGraph; dispid 21;
  418.     procedure CollectSample; dispid 20;
  419.     property Font: IFontDisp dispid -512;
  420.     property BorderStyle: SYSINT dispid -504;
  421.     property YAxisLabel: WideString dispid 18;
  422.     property ForeColor: OLE_COLOR dispid -513;
  423.     property ShowScaleLabels: WordBool dispid 4;
  424.     property ShowValueBar: WordBool dispid 5;
  425.     property Appearance: SYSINT dispid -520;
  426.     property BackColor: OLE_COLOR dispid -501;
  427.     property GraphTitle: WideString dispid 17;
  428.     property UpdateInterval: Single dispid 8;
  429.     property MaximumScale: SYSINT dispid 6;
  430.     property DisplayType: DisplayTypeConstants dispid 9;
  431.     property ManualUpdate: WordBool dispid 16;
  432.     property LogFileName: WideString dispid 34;
  433.     property Counters: ICounters dispid 0;
  434.     property MinimumScale: SYSINT dispid 7;
  435.     property BackColorCtl: OLE_COLOR dispid 33;
  436.     property TimeBarColor: OLE_COLOR dispid 38;
  437.     property GridColor: OLE_COLOR dispid 37;
  438.     property DataSourceType: DataSourceTypeConstants dispid 55;
  439.     property ReportValueType: ReportValueTypeConstants dispid 51;
  440.     property ShowToolbar: WordBool dispid 40;
  441.     property Highlight: WordBool dispid 39;
  442.     property LogViewStop: TDateTime dispid 36;
  443.     property ReadOnly: WordBool dispid 50;
  444.     property SqlDsnName: WideString dispid 56;
  445.     property ShowHorizontalGrid: WordBool dispid 2;
  446.     property LogViewStart: TDateTime dispid 35;
  447.     property ShowLegend: WordBool dispid 3;
  448.     property ShowVerticalGrid: WordBool dispid 1;
  449.     property MonitorDuplicateInstances: WordBool dispid 52;
  450.     property SqlLogSetName: WideString dispid 57;
  451.     property LogFiles: ILogFiles dispid 54;
  452.     property DisplayFilter: SYSINT dispid 53;
  453.   end;
  454.  
  455. // *********************************************************************//
  456. // Interface: ISystemMonitorEvents
  457. // Flags:     (0)
  458. // GUID:      {EE660EA0-4ABD-11CF-943A-008029004347}
  459. // *********************************************************************//
  460.   ISystemMonitorEvents = interface(IUnknown)
  461.     ['{EE660EA0-4ABD-11CF-943A-008029004347}']
  462.     procedure OnCounterSelected(index: SYSINT); stdcall;
  463.     procedure OnCounterAdded(index: SYSINT); stdcall;
  464.     procedure OnCounterDeleted(index: SYSINT); stdcall;
  465.     procedure OnSampleCollected; stdcall;
  466.     procedure OnDblClick(index: SYSINT); stdcall;
  467.   end;
  468.  
  469. // *********************************************************************//
  470. // DispIntf:  DISystemMonitorEvents
  471. // Flags:     (4096) Dispatchable
  472. // GUID:      {84979930-4AB3-11CF-943A-008029004347}
  473. // *********************************************************************//
  474.   DISystemMonitorEvents = dispinterface
  475.     ['{84979930-4AB3-11CF-943A-008029004347}']
  476.     procedure OnCounterSelected(iIndex: SYSINT); dispid 1;
  477.     procedure OnCounterAdded(iIndex: SYSINT); dispid 2;
  478.     procedure OnCounterDeleted(iIndex: SYSINT); dispid 3;
  479.     procedure OnSampleCollected; dispid 4;
  480.     procedure OnDblClick(index: SYSINT); dispid 5;
  481.   end;
  482.  
  483.  
  484. // *********************************************************************//
  485. // OLE Control Proxy class declaration
  486. // Control Name     : TSystemMonitor_
  487. // Help String      : System Monitor Control Type Information
  488. // Default Interface: DISystemMonitor
  489. // Def. Intf. DISP? : Yes
  490. // Event   Interface: DISystemMonitorEvents
  491. // TypeFlags        : (34) CanCreate Control
  492. // *********************************************************************//
  493.   TSystemMonitor_OnCounterSelected = procedure(ASender: TObject; iIndex: SYSINT) of object;
  494.   TSystemMonitor_OnCounterAdded = procedure(ASender: TObject; iIndex: SYSINT) of object;
  495.   TSystemMonitor_OnCounterDeleted = procedure(ASender: TObject; iIndex: SYSINT) of object;
  496.   TSystemMonitor_OnDblClick = procedure(ASender: TObject; index: SYSINT) of object;
  497.  
  498.   TSystemMonitor_ = class(TOleControl)
  499.   private
  500.     FOnCounterSelected: TSystemMonitor_OnCounterSelected;
  501.     FOnCounterAdded: TSystemMonitor_OnCounterAdded;
  502.     FOnCounterDeleted: TSystemMonitor_OnCounterDeleted;
  503.     FOnSampleCollected: TNotifyEvent;
  504.     FOnDblClick: TSystemMonitor_OnDblClick;
  505.     FIntf: DISystemMonitor;
  506.     function  GetControlInterface: DISystemMonitor;
  507.   protected
  508.     procedure CreateControl;
  509.     procedure InitControlData; override;
  510.     function Get_Counters: ICounters;
  511.     procedure Set_Counters(const Value: ICounters);
  512.     function Get_LogFiles: ILogFiles;
  513.     procedure Set_LogFiles(const Value: ILogFiles);
  514.   public
  515.     procedure Reset;
  516.     procedure Copy;
  517.     procedure Paste;
  518.     procedure DisplayProperties;
  519.     procedure BrowseCounters;
  520.     procedure UpdateGraph;
  521.     procedure CollectSample;
  522.     property  ControlInterface: DISystemMonitor read GetControlInterface;
  523.     property  DefaultInterface: DISystemMonitor read GetControlInterface;
  524.   published
  525.     property Anchors;
  526.     property  ParentColor;
  527.     property  ParentFont;
  528.     property  TabStop;
  529.     property  Align;
  530.     property  DragCursor;
  531.     property  DragMode;
  532.     property  ParentShowHint;
  533.     property  PopupMenu;
  534.     property  ShowHint;
  535.     property  TabOrder;
  536.     property  Visible;
  537.     property  OnDragDrop;
  538.     property  OnDragOver;
  539.     property  OnEndDrag;
  540.     property  OnEnter;
  541.     property  OnExit;
  542.     property  OnStartDrag;
  543.     property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
  544.     property BorderStyle: Integer index -504 read GetIntegerProp write SetIntegerProp stored False;
  545.     property YAxisLabel: WideString index 18 read GetWideStringProp write SetWideStringProp stored False;
  546.     property ForeColor: TColor index -513 read GetTColorProp write SetTColorProp stored False;
  547.     property ShowScaleLabels: WordBool index 4 read GetWordBoolProp write SetWordBoolProp stored False;
  548.     property ShowValueBar: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False;
  549.     property Appearance: Integer index -520 read GetIntegerProp write SetIntegerProp stored False;
  550.     property BackColor: TColor index -501 read GetTColorProp write SetTColorProp stored False;
  551.     property GraphTitle: WideString index 17 read GetWideStringProp write SetWideStringProp stored False;
  552.     property UpdateInterval: Single index 8 read GetSingleProp write SetSingleProp stored False;
  553.     property MaximumScale: Integer index 6 read GetIntegerProp write SetIntegerProp stored False;
  554.     property DisplayType: TOleEnum index 9 read GetTOleEnumProp write SetTOleEnumProp stored False;
  555.     property ManualUpdate: WordBool index 16 read GetWordBoolProp write SetWordBoolProp stored False;
  556.     property LogFileName: WideString index 34 read GetWideStringProp write SetWideStringProp stored False;
  557.     property Counters: ICounters read Get_Counters write Set_Counters stored False;
  558.     property MinimumScale: Integer index 7 read GetIntegerProp write SetIntegerProp stored False;
  559.     property BackColorCtl: TColor index 33 read GetTColorProp write SetTColorProp stored False;
  560.     property TimeBarColor: TColor index 38 read GetTColorProp write SetTColorProp stored False;
  561.     property GridColor: TColor index 37 read GetTColorProp write SetTColorProp stored False;
  562.     property DataSourceType: TOleEnum index 55 read GetTOleEnumProp write SetTOleEnumProp stored False;
  563.     property ReportValueType: TOleEnum index 51 read GetTOleEnumProp write SetTOleEnumProp stored False;
  564.     property ShowToolbar: WordBool index 40 read GetWordBoolProp write SetWordBoolProp stored False;
  565.     property Highlight: WordBool index 39 read GetWordBoolProp write SetWordBoolProp stored False;
  566.     property LogViewStop: TDateTime index 36 read GetTDateTimeProp write SetTDateTimeProp stored False;
  567.     property ReadOnly: WordBool index 50 read GetWordBoolProp write SetWordBoolProp stored False;
  568.     property SqlDsnName: WideString index 56 read GetWideStringProp write SetWideStringProp stored False;
  569.     property ShowHorizontalGrid: WordBool index 2 read GetWordBoolProp write SetWordBoolProp stored False;
  570.     property LogViewStart: TDateTime index 35 read GetTDateTimeProp write SetTDateTimeProp stored False;
  571.     property ShowLegend: WordBool index 3 read GetWordBoolProp write SetWordBoolProp stored False;
  572.     property ShowVerticalGrid: WordBool index 1 read GetWordBoolProp write SetWordBoolProp stored False;
  573.     property MonitorDuplicateInstances: WordBool index 52 read GetWordBoolProp write SetWordBoolProp stored False;
  574.     property SqlLogSetName: WideString index 57 read GetWideStringProp write SetWideStringProp stored False;
  575.     property LogFiles: ILogFiles read Get_LogFiles write Set_LogFiles stored False;
  576.     property DisplayFilter: Integer index 53 read GetIntegerProp write SetIntegerProp stored False;
  577.     property OnCounterSelected: TSystemMonitor_OnCounterSelected read FOnCounterSelected write FOnCounterSelected;
  578.     property OnCounterAdded: TSystemMonitor_OnCounterAdded read FOnCounterAdded write FOnCounterAdded;
  579.     property OnCounterDeleted: TSystemMonitor_OnCounterDeleted read FOnCounterDeleted write FOnCounterDeleted;
  580.     property OnSampleCollected: TNotifyEvent read FOnSampleCollected write FOnSampleCollected;
  581.     property OnDblClick: TSystemMonitor_OnDblClick read FOnDblClick write FOnDblClick;
  582.   end;
  583.  
  584.  
  585. // *********************************************************************//
  586. // OLE Control Proxy class declaration
  587. // Control Name     : TCounterItem
  588. // Help String      : System Monitor Counter Item Type Information
  589. // Default Interface: DICounterItem
  590. // Def. Intf. DISP? : Yes
  591. // Event   Interface:
  592. // TypeFlags        : (34) CanCreate Control
  593. // *********************************************************************//
  594.   TCounterItem = class(TOleControl)
  595.   private
  596.     FIntf: DICounterItem;
  597.     function  GetControlInterface: DICounterItem;
  598.   protected
  599.     procedure CreateControl;
  600.     procedure InitControlData; override;
  601.   public
  602.     procedure GetValue(out Value: Double; out Status: Integer);
  603.     procedure GetStatistics(out Max: Double; out Min: Double; out Avg: Double; out Status: Integer);
  604.     property  ControlInterface: DICounterItem read GetControlInterface;
  605.     property  DefaultInterface: DICounterItem read GetControlInterface;
  606.     property Value: Double index 0 read GetDoubleProp;
  607.     property Path: WideString index 5 read GetWideStringProp;
  608.   published
  609.     property Anchors;
  610.     property Color: TColor index 1 read GetTColorProp write SetTColorProp stored False;
  611.     property LineStyle: Integer index 3 read GetIntegerProp write SetIntegerProp stored False;
  612.     property ScaleFactor: Integer index 4 read GetIntegerProp write SetIntegerProp stored False;
  613.   end;
  614.  
  615. // *********************************************************************//
  616. // The Class CoCounters provides a Create and CreateRemote method to          
  617. // create instances of the default interface ICounters exposed by              
  618. // the CoClass Counters. The functions are intended to be used by            
  619. // clients wishing to automate the CoClass objects exposed by the        
  620. // server of this typelibrary.                                            
  621. // *********************************************************************//
  622.   CoCounters = class
  623.     class function Create: ICounters;
  624.     class function CreateRemote(const MachineName: string): ICounters;
  625.   end;
  626.  
  627.  
  628. // *********************************************************************//
  629. // OLE Server Proxy class declaration
  630. // Server Object    : TCounters
  631. // Help String      : System Monitor Counter Collection Type Information
  632. // Default Interface: ICounters
  633. // Def. Intf. DISP? : No
  634. // Event   Interface:
  635. // TypeFlags        : (2) CanCreate
  636. // *********************************************************************//
  637. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  638.   TCountersProperties= class;
  639. {$ENDIF}
  640.   TCounters = class(TOleServer)
  641.   private
  642.     FIntf: ICounters;
  643. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  644.     FProps: TCountersProperties;
  645.     function GetServerProperties: TCountersProperties;
  646. {$ENDIF}
  647.     function GetDefaultInterface: ICounters;
  648.   protected
  649.     procedure InitServerData; override;
  650.     function Get_Count: Integer;
  651.     function Get_Item(index: OleVariant): DICounterItem;
  652.   public
  653.     constructor Create(AOwner: TComponent); override;
  654.     destructor  Destroy; override;
  655.     procedure Connect; override;
  656.     procedure ConnectTo(svrIntf: ICounters);
  657.     procedure Disconnect; override;
  658.     function Add(const pathname: WideString): DICounterItem;
  659.     procedure Remove(index: OleVariant);
  660.     property DefaultInterface: ICounters read GetDefaultInterface;
  661.     property Count: Integer read Get_Count;
  662.     property Item[index: OleVariant]: DICounterItem read Get_Item; default;
  663.   published
  664. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  665.     property Server: TCountersProperties read GetServerProperties;
  666. {$ENDIF}
  667.   end;
  668.  
  669. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  670. // *********************************************************************//
  671. // OLE Server Properties Proxy Class
  672. // Server Object    : TCounters
  673. // (This object is used by the IDE's Property Inspector to allow editing
  674. //  of the properties of this server)
  675. // *********************************************************************//
  676.  TCountersProperties = class(TPersistent)
  677.   private
  678.     FServer:    TCounters;
  679.     function    GetDefaultInterface: ICounters;
  680.     constructor Create(AServer: TCounters);
  681.   protected
  682.     function Get_Count: Integer;
  683.     function Get_Item(index: OleVariant): DICounterItem;
  684.   public
  685.     property DefaultInterface: ICounters read GetDefaultInterface;
  686.   published
  687.   end;
  688. {$ENDIF}
  689.  
  690.  
  691.  
  692. // *********************************************************************//
  693. // OLE Control Proxy class declaration
  694. // Control Name     : TLogFileItem
  695. // Help String      : System Monitor Log File Item Type Information
  696. // Default Interface: DILogFileItem
  697. // Def. Intf. DISP? : Yes
  698. // Event   Interface:
  699. // TypeFlags        : (34) CanCreate Control
  700. // *********************************************************************//
  701.   TLogFileItem = class(TOleControl)
  702.   private
  703.     FIntf: DILogFileItem;
  704.     function  GetControlInterface: DILogFileItem;
  705.   protected
  706.     procedure CreateControl;
  707.     procedure InitControlData; override;
  708.   public
  709.     property  ControlInterface: DILogFileItem read GetControlInterface;
  710.     property  DefaultInterface: DILogFileItem read GetControlInterface;
  711.     property Path: WideString index 0 read GetWideStringProp;
  712.   published
  713.     property Anchors;
  714.   end;
  715.  
  716. // *********************************************************************//
  717. // The Class CoLogFiles provides a Create and CreateRemote method to          
  718. // create instances of the default interface ILogFiles exposed by              
  719. // the CoClass LogFiles. The functions are intended to be used by            
  720. // clients wishing to automate the CoClass objects exposed by the        
  721. // server of this typelibrary.                                            
  722. // *********************************************************************//
  723.   CoLogFiles = class
  724.     class function Create: ILogFiles;
  725.     class function CreateRemote(const MachineName: string): ILogFiles;
  726.   end;
  727.  
  728.  
  729. // *********************************************************************//
  730. // OLE Server Proxy class declaration
  731. // Server Object    : TLogFiles
  732. // Help String      : System Monitor Log File Collection Type Information
  733. // Default Interface: ILogFiles
  734. // Def. Intf. DISP? : No
  735. // Event   Interface:
  736. // TypeFlags        : (2) CanCreate
  737. // *********************************************************************//
  738. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  739.   TLogFilesProperties= class;
  740. {$ENDIF}
  741.   TLogFiles = class(TOleServer)
  742.   private
  743.     FIntf: ILogFiles;
  744. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  745.     FProps: TLogFilesProperties;
  746.     function GetServerProperties: TLogFilesProperties;
  747. {$ENDIF}
  748.     function GetDefaultInterface: ILogFiles;
  749.   protected
  750.     procedure InitServerData; override;
  751.     function Get_Count: Integer;
  752.     function Get_Item(index: OleVariant): DILogFileItem;
  753.   public
  754.     constructor Create(AOwner: TComponent); override;
  755.     destructor  Destroy; override;
  756.     procedure Connect; override;
  757.     procedure ConnectTo(svrIntf: ILogFiles);
  758.     procedure Disconnect; override;
  759.     function Add(const pathname: WideString): DILogFileItem;
  760.     procedure Remove(index: OleVariant);
  761.     property DefaultInterface: ILogFiles read GetDefaultInterface;
  762.     property Count: Integer read Get_Count;
  763.     property Item[index: OleVariant]: DILogFileItem read Get_Item; default;
  764.   published
  765. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  766.     property Server: TLogFilesProperties read GetServerProperties;
  767. {$ENDIF}
  768.   end;
  769.  
  770. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  771. // *********************************************************************//
  772. // OLE Server Properties Proxy Class
  773. // Server Object    : TLogFiles
  774. // (This object is used by the IDE's Property Inspector to allow editing
  775. //  of the properties of this server)
  776. // *********************************************************************//
  777.  TLogFilesProperties = class(TPersistent)
  778.   private
  779.     FServer:    TLogFiles;
  780.     function    GetDefaultInterface: ILogFiles;
  781.     constructor Create(AServer: TLogFiles);
  782.   protected
  783.     function Get_Count: Integer;
  784.     function Get_Item(index: OleVariant): DILogFileItem;
  785.   public
  786.     property DefaultInterface: ILogFiles read GetDefaultInterface;
  787.   published
  788.   end;
  789. {$ENDIF}
  790.  
  791.  
  792. procedure Register;
  793.  
  794. resourcestring
  795.   dtlServerPage = 'ActiveX';
  796.  
  797.   dtlOcxPage = 'ActiveX';
  798.  
  799. implementation
  800.  
  801. uses ComObj;
  802.  
  803. procedure TSystemMonitor_.InitControlData;
  804. const
  805.   CEventDispIDs: array [0..4] of DWORD = (
  806.     $00000001, $00000002, $00000003, $00000004, $00000005);
  807.   CTFontIDs: array [0..0] of DWORD = (
  808.     $FFFFFE00);
  809.   CControlData: TControlData2 = (
  810.     ClassID: '{C4D2D8E0-D1DD-11CE-940F-008029004347}';
  811.     EventIID: '{84979930-4AB3-11CF-943A-008029004347}';
  812.     EventCount: 5;
  813.     EventDispIDs: @CEventDispIDs;
  814.     LicenseKey: nil (*HR:$80004002*);
  815.     Flags: $00000007;
  816.     Version: 401;
  817.     FontCount: 1;
  818.     FontIDs: @CTFontIDs);
  819. begin
  820.   ControlData := @CControlData;
  821.   TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnCounterSelected) - Cardinal(Self);
  822. end;
  823.  
  824. procedure TSystemMonitor_.CreateControl;
  825.  
  826.   procedure DoCreate;
  827.   begin
  828.     FIntf := IUnknown(OleObject) as DISystemMonitor;
  829.   end;
  830.  
  831. begin
  832.   if FIntf = nil then DoCreate;
  833. end;
  834.  
  835. function TSystemMonitor_.GetControlInterface: DISystemMonitor;
  836. begin
  837.   CreateControl;
  838.   Result := FIntf;
  839. end;
  840.  
  841. function TSystemMonitor_.Get_Counters: ICounters;
  842. begin
  843.   Result := DefaultInterface.Counters;
  844. end;
  845.  
  846. procedure TSystemMonitor_.Set_Counters(const Value: ICounters);
  847. begin
  848.   DefaultInterface.Counters := Value;
  849. end;
  850.  
  851. function TSystemMonitor_.Get_LogFiles: ILogFiles;
  852. begin
  853.   Result := DefaultInterface.LogFiles;
  854. end;
  855.  
  856. procedure TSystemMonitor_.Set_LogFiles(const Value: ILogFiles);
  857. begin
  858.   DefaultInterface.LogFiles := Value;
  859. end;
  860.  
  861. procedure TSystemMonitor_.Reset;
  862. begin
  863.   DefaultInterface.Reset;
  864. end;
  865.  
  866. procedure TSystemMonitor_.Copy;
  867. begin
  868.   DefaultInterface.Copy;
  869. end;
  870.  
  871. procedure TSystemMonitor_.Paste;
  872. begin
  873.   DefaultInterface.Paste;
  874. end;
  875.  
  876. procedure TSystemMonitor_.DisplayProperties;
  877. begin
  878.   DefaultInterface.DisplayProperties;
  879. end;
  880.  
  881. procedure TSystemMonitor_.BrowseCounters;
  882. begin
  883.   DefaultInterface.BrowseCounters;
  884. end;
  885.  
  886. procedure TSystemMonitor_.UpdateGraph;
  887. begin
  888.   DefaultInterface.UpdateGraph;
  889. end;
  890.  
  891. procedure TSystemMonitor_.CollectSample;
  892. begin
  893.   DefaultInterface.CollectSample;
  894. end;
  895.  
  896. procedure TCounterItem.InitControlData;
  897. const
  898.   CControlData: TControlData2 = (
  899.     ClassID: '{C4D2D8E0-D1DD-11CE-940F-008029004348}';
  900.     EventIID: '';
  901.     EventCount: 0;
  902.     EventDispIDs: nil;
  903.     LicenseKey: nil (*HR:$80040154*);
  904.     Flags: $00000000;
  905.     Version: 401);
  906. begin
  907.   ControlData := @CControlData;
  908. end;
  909.  
  910. procedure TCounterItem.CreateControl;
  911.  
  912.   procedure DoCreate;
  913.   begin
  914.     FIntf := IUnknown(OleObject) as DICounterItem;
  915.   end;
  916.  
  917. begin
  918.   if FIntf = nil then DoCreate;
  919. end;
  920.  
  921. function TCounterItem.GetControlInterface: DICounterItem;
  922. begin
  923.   CreateControl;
  924.   Result := FIntf;
  925. end;
  926.  
  927. procedure TCounterItem.GetValue(out Value: Double; out Status: Integer);
  928. begin
  929.   DefaultInterface.GetValue(Value, Status);
  930. end;
  931.  
  932. procedure TCounterItem.GetStatistics(out Max: Double; out Min: Double; out Avg: Double;
  933.                                      out Status: Integer);
  934. begin
  935.   DefaultInterface.GetStatistics(Max, Min, Avg, Status);
  936. end;
  937.  
  938. class function CoCounters.Create: ICounters;
  939. begin
  940.   Result := CreateComObject(CLASS_Counters) as ICounters;
  941. end;
  942.  
  943. class function CoCounters.CreateRemote(const MachineName: string): ICounters;
  944. begin
  945.   Result := CreateRemoteComObject(MachineName, CLASS_Counters) as ICounters;
  946. end;
  947.  
  948. procedure TCounters.InitServerData;
  949. const
  950.   CServerData: TServerData = (
  951.     ClassID:   '{B2B066D2-2AAC-11CF-942F-008029004347}';
  952.     IntfIID:   '{79167962-28FC-11CF-942F-008029004347}';
  953.     EventIID:  '';
  954.     LicenseKey: nil;
  955.     Version: 500);
  956. begin
  957.   ServerData := @CServerData;
  958. end;
  959.  
  960. procedure TCounters.Connect;
  961. var
  962.   punk: IUnknown;
  963. begin
  964.   if FIntf = nil then
  965.   begin
  966.     punk := GetServer;
  967.     Fintf:= punk as ICounters;
  968.   end;
  969. end;
  970.  
  971. procedure TCounters.ConnectTo(svrIntf: ICounters);
  972. begin
  973.   Disconnect;
  974.   FIntf := svrIntf;
  975. end;
  976.  
  977. procedure TCounters.DisConnect;
  978. begin
  979.   if Fintf <> nil then
  980.   begin
  981.     FIntf := nil;
  982.   end;
  983. end;
  984.  
  985. function TCounters.GetDefaultInterface: ICounters;
  986. begin
  987.   if FIntf = nil then
  988.     Connect;
  989.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
  990.   Result := FIntf;
  991. end;
  992.  
  993. constructor TCounters.Create(AOwner: TComponent);
  994. begin
  995.   inherited Create(AOwner);
  996. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  997.   FProps := TCountersProperties.Create(Self);
  998. {$ENDIF}
  999. end;
  1000.  
  1001. destructor TCounters.Destroy;
  1002. begin
  1003. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1004.   FProps.Free;
  1005. {$ENDIF}
  1006.   inherited Destroy;
  1007. end;
  1008.  
  1009. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1010. function TCounters.GetServerProperties: TCountersProperties;
  1011. begin
  1012.   Result := FProps;
  1013. end;
  1014. {$ENDIF}
  1015.  
  1016. function TCounters.Get_Count: Integer;
  1017. begin
  1018.     Result := DefaultInterface.Count;
  1019. end;
  1020.  
  1021. function TCounters.Get_Item(index: OleVariant): DICounterItem;
  1022. begin
  1023.     Result := DefaultInterface.Item[index];
  1024. end;
  1025.  
  1026. function TCounters.Add(const pathname: WideString): DICounterItem;
  1027. begin
  1028.   Result := DefaultInterface.Add(pathname);
  1029. end;
  1030.  
  1031. procedure TCounters.Remove(index: OleVariant);
  1032. begin
  1033.   DefaultInterface.Remove(index);
  1034. end;
  1035.  
  1036. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1037. constructor TCountersProperties.Create(AServer: TCounters);
  1038. begin
  1039.   inherited Create;
  1040.   FServer := AServer;
  1041. end;
  1042.  
  1043. function TCountersProperties.GetDefaultInterface: ICounters;
  1044. begin
  1045.   Result := FServer.DefaultInterface;
  1046. end;
  1047.  
  1048. function TCountersProperties.Get_Count: Integer;
  1049. begin
  1050.     Result := DefaultInterface.Count;
  1051. end;
  1052.  
  1053. function TCountersProperties.Get_Item(index: OleVariant): DICounterItem;
  1054. begin
  1055.     Result := DefaultInterface.Item[index];
  1056. end;
  1057.  
  1058. {$ENDIF}
  1059.  
  1060. procedure TLogFileItem.InitControlData;
  1061. const
  1062.   CControlData: TControlData2 = (
  1063.     ClassID: '{16EC5BE8-DF93-4237-94E4-9EE918111D71}';
  1064.     EventIID: '';
  1065.     EventCount: 0;
  1066.     EventDispIDs: nil;
  1067.     LicenseKey: nil (*HR:$80040154*);
  1068.     Flags: $00000000;
  1069.     Version: 401);
  1070. begin
  1071.   ControlData := @CControlData;
  1072. end;
  1073.  
  1074. procedure TLogFileItem.CreateControl;
  1075.  
  1076.   procedure DoCreate;
  1077.   begin
  1078.     FIntf := IUnknown(OleObject) as DILogFileItem;
  1079.   end;
  1080.  
  1081. begin
  1082.   if FIntf = nil then DoCreate;
  1083. end;
  1084.  
  1085. function TLogFileItem.GetControlInterface: DILogFileItem;
  1086. begin
  1087.   CreateControl;
  1088.   Result := FIntf;
  1089. end;
  1090.  
  1091. class function CoLogFiles.Create: ILogFiles;
  1092. begin
  1093.   Result := CreateComObject(CLASS_LogFiles) as ILogFiles;
  1094. end;
  1095.  
  1096. class function CoLogFiles.CreateRemote(const MachineName: string): ILogFiles;
  1097. begin
  1098.   Result := CreateRemoteComObject(MachineName, CLASS_LogFiles) as ILogFiles;
  1099. end;
  1100.  
  1101. procedure TLogFiles.InitServerData;
  1102. const
  1103.   CServerData: TServerData = (
  1104.     ClassID:   '{2735D9FD-F6B9-4F19-A5D9-E2D068584BC5}';
  1105.     IntfIID:   '{6A2A97E6-6851-41EA-87AD-2A8225335865}';
  1106.     EventIID:  '';
  1107.     LicenseKey: nil;
  1108.     Version: 500);
  1109. begin
  1110.   ServerData := @CServerData;
  1111. end;
  1112.  
  1113. procedure TLogFiles.Connect;
  1114. var
  1115.   punk: IUnknown;
  1116. begin
  1117.   if FIntf = nil then
  1118.   begin
  1119.     punk := GetServer;
  1120.     Fintf:= punk as ILogFiles;
  1121.   end;
  1122. end;
  1123.  
  1124. procedure TLogFiles.ConnectTo(svrIntf: ILogFiles);
  1125. begin
  1126.   Disconnect;
  1127.   FIntf := svrIntf;
  1128. end;
  1129.  
  1130. procedure TLogFiles.DisConnect;
  1131. begin
  1132.   if Fintf <> nil then
  1133.   begin
  1134.     FIntf := nil;
  1135.   end;
  1136. end;
  1137.  
  1138. function TLogFiles.GetDefaultInterface: ILogFiles;
  1139. begin
  1140.   if FIntf = nil then
  1141.     Connect;
  1142.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call "Connect" or "ConnectTo" before this operation');
  1143.   Result := FIntf;
  1144. end;
  1145.  
  1146. constructor TLogFiles.Create(AOwner: TComponent);
  1147. begin
  1148.   inherited Create(AOwner);
  1149. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1150.   FProps := TLogFilesProperties.Create(Self);
  1151. {$ENDIF}
  1152. end;
  1153.  
  1154. destructor TLogFiles.Destroy;
  1155. begin
  1156. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1157.   FProps.Free;
  1158. {$ENDIF}
  1159.   inherited Destroy;
  1160. end;
  1161.  
  1162. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1163. function TLogFiles.GetServerProperties: TLogFilesProperties;
  1164. begin
  1165.   Result := FProps;
  1166. end;
  1167. {$ENDIF}
  1168.  
  1169. function TLogFiles.Get_Count: Integer;
  1170. begin
  1171.     Result := DefaultInterface.Count;
  1172. end;
  1173.  
  1174. function TLogFiles.Get_Item(index: OleVariant): DILogFileItem;
  1175. begin
  1176.     Result := DefaultInterface.Item[index];
  1177. end;
  1178.  
  1179. function TLogFiles.Add(const pathname: WideString): DILogFileItem;
  1180. begin
  1181.   Result := DefaultInterface.Add(pathname);
  1182. end;
  1183.  
  1184. procedure TLogFiles.Remove(index: OleVariant);
  1185. begin
  1186.   DefaultInterface.Remove(index);
  1187. end;
  1188.  
  1189. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1190. constructor TLogFilesProperties.Create(AServer: TLogFiles);
  1191. begin
  1192.   inherited Create;
  1193.   FServer := AServer;
  1194. end;
  1195.  
  1196. function TLogFilesProperties.GetDefaultInterface: ILogFiles;
  1197. begin
  1198.   Result := FServer.DefaultInterface;
  1199. end;
  1200.  
  1201. function TLogFilesProperties.Get_Count: Integer;
  1202. begin
  1203.     Result := DefaultInterface.Count;
  1204. end;
  1205.  
  1206. function TLogFilesProperties.Get_Item(index: OleVariant): DILogFileItem;
  1207. begin
  1208.     Result := DefaultInterface.Item[index];
  1209. end;
  1210.  
  1211. {$ENDIF}
  1212.  
  1213. procedure Register;
  1214. begin
  1215.   RegisterComponents(dtlOcxPage, [TSystemMonitor_, TCounterItem, TLogFileItem]);
  1216.   RegisterComponents(dtlServerPage, [TCounters, TLogFiles]);
  1217. end;
  1218.  
  1219. end.