This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

SystemMonitor_TLB for Delphi 2006 Win32

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