B
blsm
Unregistered / Unconfirmed
GUEST, unregistred user!
//导入生成的文件在此
//大家能不能给我一些提示
//我该如何做
//我主要需要用到
// IOperation 和IPluginFolder
//需要如何去做
//还有,基本相同的代码(关于这个com),就两行
//vb可以用,delphi使用就报错,为什么
//大家要是能给我帮助
//分数不是问题
//谢谢
//CodeOFDelphi
Self.PluginFolder1.ScanAll:=True;
self.PluginFolder1.Path:=ExtractFilePath(Application.ExeName)+'Plugin/';
for i:=1 to self.PluginFolder1.Plugins.Count do
begin
Self.ComboBox1.Items.Add(Self.PluginFolder1.Plugins.Get_Name);
end;
//codeof vb
Private Sub Form_Load()
With tPlugin
.ScanAll = -True
.Path = App.Path & "/plugin"
End With
For i = 0 To tPlugin.Plugins.Count
Combo1.AddItem tPlugin.Plugins(i).Name
Next
End Sub
unit Achroma_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// PASTLWTR : $Revision: 1.88 $
// File generated on 2000-10-8 7:32:13 from Type Library described below.
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
// ************************************************************************ //
// Type Lib: C:/Program Files/ImageExpress/plugin.dll (1)
// IID/LCID: {D2BBB9E3-CDC4-45E4-BAC9-8362B67A91EF}/0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (C:/WINNT/System32/stdole2.tlb)
// (2) v4.0 StdVCL, (C:/WINNT/System32/STDVCL40.DLL)
// Errors:
// Hint: Member 'Type' of 'IPlugin' changed to 'Type_'
// Hint: Member 'String' of 'IXRect' changed to 'String_'
// Hint: Member 'String' of 'IXColor' changed to 'String_'
// Error creating palette bitmap of (TPluginFolder) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TImageforPlugIN) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TXRect) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TXColor) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
AchromaMajorVersion = 1;
AchromaMinorVersion = 0;
LIBID_Achroma: TGUID = '{D2BBB9E3-CDC4-45E4-BAC9-8362B67A91EF}';
DIID__IOperationEvents: TGUID = '{2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}';
DIID__IPluginFolderEvents: TGUID = '{C1497B5E-1824-4DE4-AD8E-0129791783FF}';
IID_IPluginFolder: TGUID = '{997AFF92-4E12-466A-8FD4-BCF6D088B73A}';
CLASS_PluginFolder: TGUID = '{D7C1F25D-B95F-4C74-BF3C-17B749623DDA}';
IID_IPlugins: TGUID = '{10B1E34E-3B32-45FC-848A-F695D712C6C4}';
IID_IPlugin: TGUID = '{1754BFBB-2548-4D07-A38F-E44E5680D15F}';
IID_IOperation: TGUID = '{5D14275E-EC14-4C89-9F34-D1A004054918}';
IID_IImage: TGUID = '{39975D21-D501-439C-8136-30EB653C0214}';
IID_IXRect: TGUID = '{918FDCE5-D8EA-4516-B045-434E062B5B5D}';
IID_IXColor: TGUID = '{46B2AB1D-30BE-493B-A293-51AF1BECB87E}';
CLASS_Plugin: TGUID = '{266B5026-F220-4284-8C7D-86A27B2D57D6}';
CLASS_Operation: TGUID = '{3209FE67-F314-4FFF-B5AD-16B95C4B0AB3}';
CLASS_Plugins: TGUID = '{8772236E-5A7B-4586-AC5B-16AE422EB5F5}';
CLASS_Image: TGUID = '{0B186389-1108-4B00-A304-99910D403BBD}';
CLASS_XRect: TGUID = '{1918E481-D4AB-4781-B3D3-D9B02470FFFB}';
CLASS_XColor: TGUID = '{C41944E7-F40D-4305-89E4-FFBAFEB50A53}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_IOperationEvents = dispinterface;
_IPluginFolderEvents = dispinterface;
IPluginFolder = interface;
IPluginFolderDisp = dispinterface;
IPlugins = interface;
IPluginsDisp = dispinterface;
IPlugin = interface;
IPluginDisp = dispinterface;
IOperation = interface;
IOperationDisp = dispinterface;
IImage = interface;
IImageDisp = dispinterface;
IXRect = interface;
IXRectDisp = dispinterface;
IXColor = interface;
IXColorDisp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
PluginFolder = IPluginFolder;
Plugin = IPlugin;
Operation = IOperation;
Plugins = IPlugins;
Image = IImage;
XRect = IXRect;
XColor = IXColor;
// *********************************************************************//
// DispIntf: _IOperationEvents
// Flags: (4096) Dispatchable
// GUID: {2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}
// *********************************************************************//
_IOperationEvents = dispinterface
['{2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}']
procedure Progress(done: Integer; total: Integer; var cncl: WordBool); dispid 1;
end;
// *********************************************************************//
// DispIntf: _IPluginFolderEvents
// Flags: (4096) Dispatchable
// GUID: {C1497B5E-1824-4DE4-AD8E-0129791783FF}
// *********************************************************************//
_IPluginFolderEvents = dispinterface
['{C1497B5E-1824-4DE4-AD8E-0129791783FF}']
procedure Progress(done: Integer; total: Integer; var cncl: WordBool); dispid 1;
end;
// *********************************************************************//
// Interface: IPluginFolder
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {997AFF92-4E12-466A-8FD4-BCF6D088B73A}
// *********************************************************************//
IPluginFolder = interface(IDispatch)
['{997AFF92-4E12-466A-8FD4-BCF6D088B73A}']
function Get_Path: WideString; safecall;
procedure Set_Path(const pVal: WideString); safecall;
function Get_MaxDepth: Integer; safecall;
procedure Set_MaxDepth(pVal: Integer); safecall;
function Get_ScanAll: WordBool; safecall;
procedure Set_ScanAll(pVal: WordBool); safecall;
function Get_Libraries: WideString; safecall;
procedure Set_Libraries(const pVal: WideString); safecall;
function Get_Plugins: IPlugins; safecall;
function Get_AvailableMemory: Integer; safecall;
function AutoDetect: WordBool; safecall;
function GetReadFormat(const inPath: WideString): IOperation; safecall;
function GetWriteFormat(const inPath: WideString): IOperation; safecall;
function GetFilter(const inName: WideString): IOperation; safecall;
function GetExport(const inName: WideString): IOperation; safecall;
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
property Plugins: IPlugins read Get_Plugins;
property AvailableMemory: Integer read Get_AvailableMemory;
end;
// *********************************************************************//
// DispIntf: IPluginFolderDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {997AFF92-4E12-466A-8FD4-BCF6D088B73A}
// *********************************************************************//
IPluginFolderDisp = dispinterface
['{997AFF92-4E12-466A-8FD4-BCF6D088B73A}']
property Path: WideString dispid 1;
property MaxDepth: Integer dispid 2;
property ScanAll: WordBool dispid 3;
property Libraries: WideString dispid 4;
property Plugins: IPlugins readonly dispid 5;
property AvailableMemory: Integer readonly dispid 6;
function AutoDetect: WordBool; dispid 7;
function GetReadFormat(const inPath: WideString): IOperation; dispid 8;
function GetWriteFormat(const inPath: WideString): IOperation; dispid 9;
function GetFilter(const inName: WideString): IOperation; dispid 10;
function GetExport(const inName: WideString): IOperation; dispid 11;
end;
// *********************************************************************//
// Interface: IPlugins
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {10B1E34E-3B32-45FC-848A-F695D712C6C4}
// *********************************************************************//
IPlugins = interface(IDispatch)
['{10B1E34E-3B32-45FC-848A-F695D712C6C4}']
function Get__NewEnum: IUnknown; safecall;
function Get_Item(inIndex: OleVariant): IPlugin; safecall;
function Get_Count: Integer; safecall;
property _NewEnum: IUnknown read Get__NewEnum;
property Item[inIndex: OleVariant]: IPlugin read Get_Item; default;
property Count: Integer read Get_Count;
end;
// *********************************************************************//
// DispIntf: IPluginsDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {10B1E34E-3B32-45FC-848A-F695D712C6C4}
// *********************************************************************//
IPluginsDisp = dispinterface
['{10B1E34E-3B32-45FC-848A-F695D712C6C4}']
property _NewEnum: IUnknown readonly dispid -4;
property Item[inIndex: OleVariant]: IPlugin readonly dispid 0; default;
property Count: Integer readonly dispid 1;
end;
// *********************************************************************//
// Interface: IPlugin
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1754BFBB-2548-4D07-A38F-E44E5680D15F}
// *********************************************************************//
IPlugin = interface(IDispatch)
['{1754BFBB-2548-4D07-A38F-E44E5680D15F}']
function Get_Type_: WideString; safecall;
function Get_Name: WideString; safecall;
function Get_Category: WideString; safecall;
function Get_ClassName: WideString; safecall;
function Get_ClassDescription: WideString; safecall;
function Get_ReadTypes: WideString; safecall;
function Get_WriteTypes: WideString; safecall;
function Get_Scriptable: WordBool; safecall;
function Get_Path: WideString; safecall;
procedure ShowAboutBox; safecall;
property Type_: WideString read Get_Type_;
property Name: WideString read Get_Name;
property Category: WideString read Get_Category;
property ClassName: WideString read Get_ClassName;
property ClassDescription: WideString read Get_ClassDescription;
property ReadTypes: WideString read Get_ReadTypes;
property WriteTypes: WideString read Get_WriteTypes;
property Scriptable: WordBool read Get_Scriptable;
property Path: WideString read Get_Path;
end;
// *********************************************************************//
// DispIntf: IPluginDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1754BFBB-2548-4D07-A38F-E44E5680D15F}
// *********************************************************************//
IPluginDisp = dispinterface
['{1754BFBB-2548-4D07-A38F-E44E5680D15F}']
property Type_: WideString readonly dispid 1;
property Name: WideString readonly dispid 2;
property Category: WideString readonly dispid 3;
property ClassName: WideString readonly dispid 4;
property ClassDescription: WideString readonly dispid 5;
property ReadTypes: WideString readonly dispid 6;
property WriteTypes: WideString readonly dispid 7;
property Scriptable: WordBool readonly dispid 8;
property Path: WideString readonly dispid 9;
procedure ShowAboutBox; dispid 10;
end;
// *********************************************************************//
// Interface: IOperation
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {5D14275E-EC14-4C89-9F34-D1A004054918}
// *********************************************************************//
IOperation = interface(IDispatch)
['{5D14275E-EC14-4C89-9F34-D1A004054918}']
function Get_Kind: WideString; safecall;
function Get_Plugin: IPlugin; safecall;
function Get_Image: IImage; safecall;
procedure Set_Image(const pVal: IImage); safecall;
function Get_Selection: IImage; safecall;
procedure Set_Selection(const pVal: IImage); safecall;
function Get_Path: WideString; safecall;
procedure Set_Path(const pVal: WideString); safecall;
function Get_TextScript: WideString; safecall;
procedure Set_TextScript(const pVal: WideString); safecall;
function Get_Silent: WordBool; safecall;
procedure Set_Silent(pVal: WordBool); safecall;
function Get_SelectionRect: IXRect; safecall;
procedure Set_SelectionRect(const pVal: IXRect); safecall;
function Get_SelectedOutside: WordBool; safecall;
procedure Set_SelectedOutside(pVal: WordBool); safecall;
function Get_ForeColor: IXColor; safecall;
procedure Set_ForeColor(const pVal: IXColor); safecall;
function Get_BackColor: IXColor; safecall;
procedure Set_BackColor(const pVal: IXColor); safecall;
function Get_Cancelled: WordBool; safecall;
procedure DoIt; safecall;
property Kind: WideString read Get_Kind;
property Plugin: IPlugin read Get_Plugin;
property Image: IImage read Get_Image write Set_Image;
property Selection: IImage read Get_Selection write Set_Selection;
property Path: WideString read Get_Path write Set_Path;
property TextScript: WideString read Get_TextScript write Set_TextScript;
property Silent: WordBool read Get_Silent write Set_Silent;
property SelectionRect: IXRect read Get_SelectionRect write Set_SelectionRect;
property SelectedOutside: WordBool read Get_SelectedOutside write Set_SelectedOutside;
property ForeColor: IXColor read Get_ForeColor write Set_ForeColor;
property BackColor: IXColor read Get_BackColor write Set_BackColor;
property Cancelled: WordBool read Get_Cancelled;
end;
// *********************************************************************//
// DispIntf: IOperationDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {5D14275E-EC14-4C89-9F34-D1A004054918}
// *********************************************************************//
IOperationDisp = dispinterface
['{5D14275E-EC14-4C89-9F34-D1A004054918}']
property Kind: WideString readonly dispid 1;
property Plugin: IPlugin readonly dispid 2;
property Image: IImage dispid 3;
property Selection: IImage dispid 4;
property Path: WideString dispid 5;
property TextScript: WideString dispid 6;
property Silent: WordBool dispid 7;
property SelectionRect: IXRect dispid 8;
property SelectedOutside: WordBool dispid 9;
property ForeColor: IXColor dispid 10;
property BackColor: IXColor dispid 11;
property Cancelled: WordBool readonly dispid 12;
procedure DoIt; dispid 13;
end;
// *********************************************************************//
// Interface: IImage
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {39975D21-D501-439C-8136-30EB653C0214}
// *********************************************************************//
IImage = interface(IDispatch)
['{39975D21-D501-439C-8136-30EB653C0214}']
function Get_Width: Integer; safecall;
function Get_Height: Integer; safecall;
function Get_Bitmap: Integer; safecall;
procedure Set_Bitmap(pVal: Integer); safecall;
function Get_OwnsBitmap: WordBool; safecall;
procedure Set_OwnsBitmap(pVal: WordBool); safecall;
function Get_Palette: Integer; safecall;
procedure Set_Palette(pVal: Integer); safecall;
function Get_OwnsPalette: WordBool; safecall;
procedure Set_OwnsPalette(pVal: WordBool); safecall;
function Get_Picture: IPicture; safecall;
procedure Set_Picture(const pVal: IPicture); safecall;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
end;
// *********************************************************************//
// DispIntf: IImageDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {39975D21-D501-439C-8136-30EB653C0214}
// *********************************************************************//
IImageDisp = dispinterface
['{39975D21-D501-439C-8136-30EB653C0214}']
property Width: Integer readonly dispid 1;
property Height: Integer readonly dispid 2;
property Bitmap: Integer dispid 3;
property OwnsBitmap: WordBool dispid 4;
property Palette: Integer dispid 5;
property OwnsPalette: WordBool dispid 6;
property Picture: IPicture dispid 7;
end;
// *********************************************************************//
// Interface: IXRect
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {918FDCE5-D8EA-4516-B045-434E062B5B5D}
// *********************************************************************//
IXRect = interface(IDispatch)
['{918FDCE5-D8EA-4516-B045-434E062B5B5D}']
function Get_String_: WideString; safecall;
procedure Set_String_(const pVal: WideString); safecall;
function Get_Top: Integer; safecall;
procedure Set_Top(pVal: Integer); safecall;
function Get_Left: Integer; safecall;
procedure Set_Left(pVal: Integer); safecall;
function Get_Bottom: Integer; safecall;
procedure Set_Bottom(pVal: Integer); safecall;
function Get_Right: Integer; safecall;
procedure Set_Right(pVal: Integer); safecall;
function Get_Width: Integer; safecall;
function Get_Height: Integer; safecall;
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
end;
// *********************************************************************//
// DispIntf: IXRectDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {918FDCE5-D8EA-4516-B045-434E062B5B5D}
// *********************************************************************//
IXRectDisp = dispinterface
['{918FDCE5-D8EA-4516-B045-434E062B5B5D}']
property String_: WideString dispid 0;
property Top: Integer dispid 1;
property Left: Integer dispid 2;
property Bottom: Integer dispid 3;
property Right: Integer dispid 4;
property Width: Integer readonly dispid 5;
property Height: Integer readonly dispid 6;
end;
// *********************************************************************//
// Interface: IXColor
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {46B2AB1D-30BE-493B-A293-51AF1BECB87E}
// *********************************************************************//
IXColor = interface(IDispatch)
['{46B2AB1D-30BE-493B-A293-51AF1BECB87E}']
function Get_String_: WideString; safecall;
procedure Set_String_(const pVal: WideString); safecall;
function Get_Red: Integer; safecall;
procedure Set_Red(pVal: Integer); safecall;
function Get_Green: Integer; safecall;
procedure Set_Green(pVal: Integer); safecall;
function Get_Blue: Integer; safecall;
procedure Set_Blue(pVal: Integer); safecall;
function Get_COLORREF: Integer; safecall;
procedure Set_COLORREF(pVal: Integer); safecall;
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
end;
// *********************************************************************//
// DispIntf: IXColorDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {46B2AB1D-30BE-493B-A293-51AF1BECB87E}
// *********************************************************************//
IXColorDisp = dispinterface
['{46B2AB1D-30BE-493B-A293-51AF1BECB87E}']
property String_: WideString dispid 0;
property Red: Integer dispid 1;
property Green: Integer dispid 2;
property Blue: Integer dispid 3;
property COLORREF: Integer dispid 4;
end;
// *********************************************************************//
// The Class CoPluginFolder provides a Create and CreateRemote method to
// create instances of the default interface IPluginFolder exposed by
// the CoClass PluginFolder. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPluginFolder = class
class function Create: IPluginFolder;
class function CreateRemote(const MachineName: string): IPluginFolder;
end;
TPluginFolderProgress = procedure(Sender: TObject; done: Integer; total: Integer;
var cncl: OleVariant) of object;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TPluginFolder
// Help String : An object you can create to specify a plugin folder
// Default Interface: IPluginFolder
// Def. Intf. DISP? : No
// Event Interface: _IPluginFolderEvents
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TPluginFolderProperties= class;
{$ENDIF}
TPluginFolder = class(TOleServer)
private
FOnProgress: TPluginFolderProgress;
FIntf: IPluginFolder;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TPluginFolderProperties;
function GetServerProperties: TPluginFolderProperties;
{$ENDIF}
function GetDefaultInterface: IPluginFolder;
protected
procedure InitServerData; override;
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
function Get_Path: WideString;
procedure Set_Path(const pVal: WideString);
function Get_MaxDepth: Integer;
procedure Set_MaxDepth(pVal: Integer);
function Get_ScanAll: WordBool;
procedure Set_ScanAll(pVal: WordBool);
function Get_Libraries: WideString;
procedure Set_Libraries(const pVal: WideString);
function Get_Plugins: IPlugins;
function Get_AvailableMemory: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IPluginFolder);
procedure Disconnect; override;
function AutoDetect: WordBool;
function GetReadFormat(const inPath: WideString): IOperation;
function GetWriteFormat(const inPath: WideString): IOperation;
function GetFilter(const inName: WideString): IOperation;
function GetExport(const inName: WideString): IOperation;
property DefaultInterface: IPluginFolder read GetDefaultInterface;
property Plugins: IPlugins read Get_Plugins;
property AvailableMemory: Integer read Get_AvailableMemory;
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TPluginFolderProperties read GetServerProperties;
{$ENDIF}
property OnProgress: TPluginFolderProgress read FOnProgress write FOnProgress;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TPluginFolder
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TPluginFolderProperties = class(TPersistent)
private
FServer: TPluginFolder;
function GetDefaultInterface: IPluginFolder;
constructor Create(AServer: TPluginFolder);
protected
function Get_Path: WideString;
procedure Set_Path(const pVal: WideString);
function Get_MaxDepth: Integer;
procedure Set_MaxDepth(pVal: Integer);
function Get_ScanAll: WordBool;
procedure Set_ScanAll(pVal: WordBool);
function Get_Libraries: WideString;
procedure Set_Libraries(const pVal: WideString);
function Get_Plugins: IPlugins;
function Get_AvailableMemory: Integer;
public
property DefaultInterface: IPluginFolder read GetDefaultInterface;
published
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoPlugin provides a Create and CreateRemote method to
// create instances of the default interface IPlugin exposed by
// the CoClass Plugin. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPlugin = class
class function Create: IPlugin;
class function CreateRemote(const MachineName: string): IPlugin;
end;
// *********************************************************************//
// The Class CoOperation provides a Create and CreateRemote method to
// create instances of the default interface IOperation exposed by
// the CoClass Operation. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoOperation = class
class function Create: IOperation;
class function CreateRemote(const MachineName: string): IOperation;
end;
// *********************************************************************//
// The Class CoPlugins provides a Create and CreateRemote method to
// create instances of the default interface IPlugins exposed by
// the CoClass Plugins. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPlugins = class
class function Create: IPlugins;
class function CreateRemote(const MachineName: string): IPlugins;
end;
// *********************************************************************//
// The Class CoImage provides a Create and CreateRemote method to
// create instances of the default interface IImage exposed by
// the CoClass Image. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoImage = class
class function Create: IImage;
class function CreateRemote(const MachineName: string): IImage;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TImageforPlugIN
// Help String : An object to allow bitmap manipulation
// Default Interface: IImage
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TImageforPlugINProperties= class;
{$ENDIF}
TImageforPlugIN = class(TOleServer)
private
FIntf: IImage;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TImageforPlugINProperties;
function GetServerProperties: TImageforPlugINProperties;
{$ENDIF}
function GetDefaultInterface: IImage;
protected
procedure InitServerData; override;
function Get_Width: Integer;
function Get_Height: Integer;
function Get_Bitmap: Integer;
procedure Set_Bitmap(pVal: Integer);
function Get_OwnsBitmap: WordBool;
procedure Set_OwnsBitmap(pVal: WordBool);
function Get_Palette: Integer;
procedure Set_Palette(pVal: Integer);
function Get_OwnsPalette: WordBool;
procedure Set_OwnsPalette(pVal: WordBool);
function Get_Picture: IPicture;
procedure Set_Picture(const pVal: IPicture);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IImage);
procedure Disconnect; override;
property DefaultInterface: IImage read GetDefaultInterface;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TImageforPlugINProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TImageforPlugIN
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TImageforPlugINProperties = class(TPersistent)
private
FServer: TImageforPlugIN;
function GetDefaultInterface: IImage;
constructor Create(AServer: TImageforPlugIN);
protected
function Get_Width: Integer;
function Get_Height: Integer;
function Get_Bitmap: Integer;
procedure Set_Bitmap(pVal: Integer);
function Get_OwnsBitmap: WordBool;
procedure Set_OwnsBitmap(pVal: WordBool);
function Get_Palette: Integer;
procedure Set_Palette(pVal: Integer);
function Get_OwnsPalette: WordBool;
procedure Set_OwnsPalette(pVal: WordBool);
function Get_Picture: IPicture;
procedure Set_Picture(const pVal: IPicture);
public
property DefaultInterface: IImage read GetDefaultInterface;
published
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoXRect provides a Create and CreateRemote method to
// create instances of the default interface IXRect exposed by
// the CoClass XRect. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoXRect = class
class function Create: IXRect;
class function CreateRemote(const MachineName: string): IXRect;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TXRect
// Help String : An object to describe a rectangle
// Default Interface: IXRect
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TXRectProperties= class;
{$ENDIF}
TXRect = class(TOleServer)
private
FIntf: IXRect;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TXRectProperties;
function GetServerProperties: TXRectProperties;
{$ENDIF}
function GetDefaultInterface: IXRect;
protected
procedure InitServerData; override;
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Top: Integer;
procedure Set_Top(pVal: Integer);
function Get_Left: Integer;
procedure Set_Left(pVal: Integer);
function Get_Bottom: Integer;
procedure Set_Bottom(pVal: Integer);
function Get_Right: Integer;
procedure Set_Right(pVal: Integer);
function Get_Width: Integer;
function Get_Height: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IXRect);
procedure Disconnect; override;
property DefaultInterface: IXRect read GetDefaultInterface;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TXRectProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TXRect
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TXRectProperties = class(TPersistent)
private
FServer: TXRect;
function GetDefaultInterface: IXRect;
constructor Create(AServer: TXRect);
protected
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Top: Integer;
procedure Set_Top(pVal: Integer);
function Get_Left: Integer;
procedure Set_Left(pVal: Integer);
function Get_Bottom: Integer;
procedure Set_Bottom(pVal: Integer);
function Get_Right: Integer;
procedure Set_Right(pVal: Integer);
function Get_Width: Integer;
function Get_Height: Integer;
public
property DefaultInterface: IXRect read GetDefaultInterface;
published
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoXColor provides a Create and CreateRemote method to
// create instances of the default interface IXColor exposed by
// the CoClass XColor. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoXColor = class
class function Create: IXColor;
class function CreateRemote(const MachineName: string): IXColor;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TXColor
// Help String : An object to describe a color
// Default Interface: IXColor
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TXColorProperties= class;
{$ENDIF}
TXColor = class(TOleServer)
private
FIntf: IXColor;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TXColorProperties;
function GetServerProperties: TXColorProperties;
{$ENDIF}
function GetDefaultInterface: IXColor;
protected
procedure InitServerData; override;
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Red: Integer;
procedure Set_Red(pVal: Integer);
function Get_Green: Integer;
procedure Set_Green(pVal: Integer);
function Get_Blue: Integer;
procedure Set_Blue(pVal: Integer);
function Get_COLORREF: Integer;
procedure Set_COLORREF(pVal: Integer);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IXColor);
procedure Disconnect; override;
property DefaultInterface: IXColor read GetDefaultInterface;
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TXColorProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TXColor
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TXColorProperties = class(TPersistent)
private
FServer: TXColor;
function GetDefaultInterface: IXColor;
constructor Create(AServer: TXColor);
protected
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Red: Integer;
procedure Set_Red(pVal: Integer);
function Get_Green: Integer;
procedure Set_Green(pVal: Integer);
function Get_Blue: Integer;
procedure Set_Blue(pVal: Integer);
function Get_COLORREF: Integer;
procedure Set_COLORREF(pVal: Integer);
public
property DefaultInterface: IXColor read GetDefaultInterface;
published
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
end;
{$ENDIF}
procedure Register;
implementation
uses ComObj;
class function CoPluginFolder.Create: IPluginFolder;
begin
Result := CreateComObject(CLASS_PluginFolder) as IPluginFolder;
end;
class function CoPluginFolder.CreateRemote(const MachineName: string): IPluginFolder;
begin
Result := CreateRemoteComObject(MachineName, CLASS_PluginFolder) as IPluginFolder;
end;
procedure TPluginFolder.InitServerData;
const
CServerData: TServerData = (
ClassID: '{D7C1F25D-B95F-4C74-BF3C-17B749623DDA}';
IntfIID: '{997AFF92-4E12-466A-8FD4-BCF6D088B73A}';
EventIID: '{C1497B5E-1824-4DE4-AD8E-0129791783FF}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TPluginFolder.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
ConnectEvents(punk);
Fintf:= punk as IPluginFolder;
end;
end;
procedure TPluginFolder.ConnectTo(svrIntf: IPluginFolder);
begin
Disconnect;
FIntf := svrIntf;
ConnectEvents(FIntf);
end;
procedure TPluginFolder.DisConnect;
begin
if Fintf <> nil then
begin
DisconnectEvents(FIntf);
FIntf := nil;
end;
end;
function TPluginFolder.GetDefaultInterface: IPluginFolder;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TPluginFolder.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TPluginFolderProperties.Create(Self);
{$ENDIF}
end;
destructor TPluginFolder.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TPluginFolder.GetServerProperties: TPluginFolderProperties;
begin
Result := FProps;
end;
{$ENDIF}
procedure TPluginFolder.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
case DispID of
-1: Exit; // DISPID_UNKNOWN
1: if Assigned(FOnProgress) then
FOnProgress(Self, Params[0] {Integer}, Params[1] {Integer}, Params[2] {var WordBool});
end; {case DispID}
end;
function TPluginFolder.Get_Path: WideString;
begin
Result := DefaultInterface.Get_Path;
end;
procedure TPluginFolder.Set_Path(const pVal: WideString);
begin
DefaultInterface.Set_Path(pVal);
end;
function TPluginFolder.Get_MaxDepth: Integer;
begin
Result := DefaultInterface.Get_MaxDepth;
end;
procedure TPluginFolder.Set_MaxDepth(pVal: Integer);
begin
DefaultInterface.Set_MaxDepth(pVal);
end;
function TPluginFolder.Get_ScanAll: WordBool;
begin
Result := DefaultInterface.Get_ScanAll;
end;
procedure TPluginFolder.Set_ScanAll(pVal: WordBool);
begin
DefaultInterface.Set_ScanAll(pVal);
end;
function TPluginFolder.Get_Libraries: WideString;
begin
Result := DefaultInterface.Get_Libraries;
end;
procedure TPluginFolder.Set_Libraries(const pVal: WideString);
begin
DefaultInterface.Set_Libraries(pVal);
end;
function TPluginFolder.Get_Plugins: IPlugins;
begin
Result := DefaultInterface.Get_Plugins;
end;
function TPluginFolder.Get_AvailableMemory: Integer;
begin
Result := DefaultInterface.Get_AvailableMemory;
end;
function TPluginFolder.AutoDetect: WordBool;
begin
Result := DefaultInterface.AutoDetect;
end;
function TPluginFolder.GetReadFormat(const inPath: WideString): IOperation;
begin
Result := DefaultInterface.GetReadFormat(inPath);
end;
function TPluginFolder.GetWriteFormat(const inPath: WideString): IOperation;
begin
Result := DefaultInterface.GetWriteFormat(inPath);
end;
function TPluginFolder.GetFilter(const inName: WideString): IOperation;
begin
Result := DefaultInterface.GetFilter(inName);
end;
function TPluginFolder.GetExport(const inName: WideString): IOperation;
begin
Result := DefaultInterface.GetExport(inName);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TPluginFolderProperties.Create(AServer: TPluginFolder);
begin
inherited Create;
FServer := AServer;
end;
function TPluginFolderProperties.GetDefaultInterface: IPluginFolder;
begin
Result := FServer.DefaultInterface;
end;
function TPluginFolderProperties.Get_Path: WideString;
begin
Result := DefaultInterface.Get_Path;
end;
procedure TPluginFolderProperties.Set_Path(const pVal: WideString);
begin
DefaultInterface.Set_Path(pVal);
end;
function TPluginFolderProperties.Get_MaxDepth: Integer;
begin
Result := DefaultInterface.Get_MaxDepth;
end;
procedure TPluginFolderProperties.Set_MaxDepth(pVal: Integer);
begin
DefaultInterface.Set_MaxDepth(pVal);
end;
function TPluginFolderProperties.Get_ScanAll: WordBool;
begin
Result := DefaultInterface.Get_ScanAll;
end;
procedure TPluginFolderProperties.Set_ScanAll(pVal: WordBool);
begin
DefaultInterface.Set_ScanAll(pVal);
end;
function TPluginFolderProperties.Get_Libraries: WideString;
begin
Result := DefaultInterface.Get_Libraries;
end;
procedure TPluginFolderProperties.Set_Libraries(const pVal: WideString);
begin
DefaultInterface.Set_Libraries(pVal);
end;
function TPluginFolderProperties.Get_Plugins: IPlugins;
begin
Result := DefaultInterface.Get_Plugins;
end;
function TPluginFolderProperties.Get_AvailableMemory: Integer;
begin
Result := DefaultInterface.Get_AvailableMemory;
end;
{$ENDIF}
class function CoPlugin.Create: IPlugin;
begin
Result := CreateComObject(CLASS_Plugin) as IPlugin;
end;
class function CoPlugin.CreateRemote(const MachineName: string): IPlugin;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Plugin) as IPlugin;
end;
class function CoOperation.Create: IOperation;
begin
Result := CreateComObject(CLASS_Operation) as IOperation;
end;
class function CoOperation.CreateRemote(const MachineName: string): IOperation;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Operation) as IOperation;
end;
class function CoPlugins.Create: IPlugins;
begin
Result := CreateComObject(CLASS_Plugins) as IPlugins;
end;
class function CoPlugins.CreateRemote(const MachineName: string): IPlugins;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Plugins) as IPlugins;
end;
class function CoImage.Create: IImage;
begin
Result := CreateComObject(CLASS_Image) as IImage;
end;
class function CoImage.CreateRemote(const MachineName: string): IImage;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Image) as IImage;
end;
procedure TImageforPlugIN.InitServerData;
const
CServerData: TServerData = (
ClassID: '{0B186389-1108-4B00-A304-99910D403BBD}';
IntfIID: '{39975D21-D501-439C-8136-30EB653C0214}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TImageforPlugIN.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IImage;
end;
end;
procedure TImageforPlugIN.ConnectTo(svrIntf: IImage);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TImageforPlugIN.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TImageforPlugIN.GetDefaultInterface: IImage;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TImageforPlugIN.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TImageforPlugINProperties.Create(Self);
{$ENDIF}
end;
destructor TImageforPlugIN.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TImageforPlugIN.GetServerProperties: TImageforPlugINProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TImageforPlugIN.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TImageforPlugIN.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
function TImageforPlugIN.Get_Bitmap: Integer;
begin
Result := DefaultInterface.Get_Bitmap;
end;
procedure TImageforPlugIN.Set_Bitmap(pVal: Integer);
begin
DefaultInterface.Set_Bitmap(pVal);
end;
function TImageforPlugIN.Get_OwnsBitmap: WordBool;
begin
Result := DefaultInterface.Get_OwnsBitmap;
end;
procedure TImageforPlugIN.Set_OwnsBitmap(pVal: WordBool);
begin
DefaultInterface.Set_OwnsBitmap(pVal);
end;
function TImageforPlugIN.Get_Palette: Integer;
begin
Result := DefaultInterface.Get_Palette;
end;
procedure TImageforPlugIN.Set_Palette(pVal: Integer);
begin
DefaultInterface.Set_Palette(pVal);
end;
function TImageforPlugIN.Get_OwnsPalette: WordBool;
begin
Result := DefaultInterface.Get_OwnsPalette;
end;
procedure TImageforPlugIN.Set_OwnsPalette(pVal: WordBool);
begin
DefaultInterface.Set_OwnsPalette(pVal);
end;
function TImageforPlugIN.Get_Picture: IPicture;
begin
Result := DefaultInterface.Get_Picture;
end;
procedure TImageforPlugIN.Set_Picture(const pVal: IPicture);
begin
DefaultInterface.Set_Picture(pVal);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TImageforPlugINProperties.Create(AServer: TImageforPlugIN);
begin
inherited Create;
FServer := AServer;
end;
function TImageforPlugINProperties.GetDefaultInterface: IImage;
begin
Result := FServer.DefaultInterface;
end;
function TImageforPlugINProperties.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TImageforPlugINProperties.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
function TImageforPlugINProperties.Get_Bitmap: Integer;
begin
Result := DefaultInterface.Get_Bitmap;
end;
procedure TImageforPlugINProperties.Set_Bitmap(pVal: Integer);
begin
DefaultInterface.Set_Bitmap(pVal);
end;
function TImageforPlugINProperties.Get_OwnsBitmap: WordBool;
begin
Result := DefaultInterface.Get_OwnsBitmap;
end;
procedure TImageforPlugINProperties.Set_OwnsBitmap(pVal: WordBool);
begin
DefaultInterface.Set_OwnsBitmap(pVal);
end;
function TImageforPlugINProperties.Get_Palette: Integer;
begin
Result := DefaultInterface.Get_Palette;
end;
procedure TImageforPlugINProperties.Set_Palette(pVal: Integer);
begin
DefaultInterface.Set_Palette(pVal);
end;
function TImageforPlugINProperties.Get_OwnsPalette: WordBool;
begin
Result := DefaultInterface.Get_OwnsPalette;
end;
procedure TImageforPlugINProperties.Set_OwnsPalette(pVal: WordBool);
begin
DefaultInterface.Set_OwnsPalette(pVal);
end;
function TImageforPlugINProperties.Get_Picture: IPicture;
begin
Result := DefaultInterface.Get_Picture;
end;
procedure TImageforPlugINProperties.Set_Picture(const pVal: IPicture);
begin
DefaultInterface.Set_Picture(pVal);
end;
{$ENDIF}
class function CoXRect.Create: IXRect;
begin
Result := CreateComObject(CLASS_XRect) as IXRect;
end;
class function CoXRect.CreateRemote(const MachineName: string): IXRect;
begin
Result := CreateRemoteComObject(MachineName, CLASS_XRect) as IXRect;
end;
procedure TXRect.InitServerData;
const
CServerData: TServerData = (
ClassID: '{1918E481-D4AB-4781-B3D3-D9B02470FFFB}';
IntfIID: '{918FDCE5-D8EA-4516-B045-434E062B5B5D}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TXRect.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IXRect;
end;
end;
procedure TXRect.ConnectTo(svrIntf: IXRect);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TXRect.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TXRect.GetDefaultInterface: IXRect;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TXRect.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TXRectProperties.Create(Self);
{$ENDIF}
end;
destructor TXRect.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TXRect.GetServerProperties: TXRectProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TXRect.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXRect.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXRect.Get_Top: Integer;
begin
Result := DefaultInterface.Get_Top;
end;
procedure TXRect.Set_Top(pVal: Integer);
begin
DefaultInterface.Set_Top(pVal);
end;
function TXRect.Get_Left: Integer;
begin
Result := DefaultInterface.Get_Left;
end;
procedure TXRect.Set_Left(pVal: Integer);
begin
DefaultInterface.Set_Left(pVal);
end;
function TXRect.Get_Bottom: Integer;
begin
Result := DefaultInterface.Get_Bottom;
end;
procedure TXRect.Set_Bottom(pVal: Integer);
begin
DefaultInterface.Set_Bottom(pVal);
end;
function TXRect.Get_Right: Integer;
begin
Result := DefaultInterface.Get_Right;
end;
procedure TXRect.Set_Right(pVal: Integer);
begin
DefaultInterface.Set_Right(pVal);
end;
function TXRect.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TXRect.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TXRectProperties.Create(AServer: TXRect);
begin
inherited Create;
FServer := AServer;
end;
function TXRectProperties.GetDefaultInterface: IXRect;
begin
Result := FServer.DefaultInterface;
end;
function TXRectProperties.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXRectProperties.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXRectProperties.Get_Top: Integer;
begin
Result := DefaultInterface.Get_Top;
end;
procedure TXRectProperties.Set_Top(pVal: Integer);
begin
DefaultInterface.Set_Top(pVal);
end;
function TXRectProperties.Get_Left: Integer;
begin
Result := DefaultInterface.Get_Left;
end;
procedure TXRectProperties.Set_Left(pVal: Integer);
begin
DefaultInterface.Set_Left(pVal);
end;
function TXRectProperties.Get_Bottom: Integer;
begin
Result := DefaultInterface.Get_Bottom;
end;
procedure TXRectProperties.Set_Bottom(pVal: Integer);
begin
DefaultInterface.Set_Bottom(pVal);
end;
function TXRectProperties.Get_Right: Integer;
begin
Result := DefaultInterface.Get_Right;
end;
procedure TXRectProperties.Set_Right(pVal: Integer);
begin
DefaultInterface.Set_Right(pVal);
end;
function TXRectProperties.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TXRectProperties.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
{$ENDIF}
class function CoXColor.Create: IXColor;
begin
Result := CreateComObject(CLASS_XColor) as IXColor;
end;
class function CoXColor.CreateRemote(const MachineName: string): IXColor;
begin
Result := CreateRemoteComObject(MachineName, CLASS_XColor) as IXColor;
end;
procedure TXColor.InitServerData;
const
CServerData: TServerData = (
ClassID: '{C41944E7-F40D-4305-89E4-FFBAFEB50A53}';
IntfIID: '{46B2AB1D-30BE-493B-A293-51AF1BECB87E}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TXColor.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IXColor;
end;
end;
procedure TXColor.ConnectTo(svrIntf: IXColor);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TXColor.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TXColor.GetDefaultInterface: IXColor;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TXColor.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TXColorProperties.Create(Self);
{$ENDIF}
end;
destructor TXColor.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TXColor.GetServerProperties: TXColorProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TXColor.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXColor.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXColor.Get_Red: Integer;
begin
Result := DefaultInterface.Get_Red;
end;
procedure TXColor.Set_Red(pVal: Integer);
begin
DefaultInterface.Set_Red(pVal);
end;
function TXColor.Get_Green: Integer;
begin
Result := DefaultInterface.Get_Green;
end;
procedure TXColor.Set_Green(pVal: Integer);
begin
DefaultInterface.Set_Green(pVal);
end;
function TXColor.Get_Blue: Integer;
begin
Result := DefaultInterface.Get_Blue;
end;
procedure TXColor.Set_Blue(pVal: Integer);
begin
DefaultInterface.Set_Blue(pVal);
end;
function TXColor.Get_COLORREF: Integer;
begin
Result := DefaultInterface.Get_COLORREF;
end;
procedure TXColor.Set_COLORREF(pVal: Integer);
begin
DefaultInterface.Set_COLORREF(pVal);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TXColorProperties.Create(AServer: TXColor);
begin
inherited Create;
FServer := AServer;
end;
function TXColorProperties.GetDefaultInterface: IXColor;
begin
Result := FServer.DefaultInterface;
end;
function TXColorProperties.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXColorProperties.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXColorProperties.Get_Red: Integer;
begin
Result := DefaultInterface.Get_Red;
end;
procedure TXColorProperties.Set_Red(pVal: Integer);
begin
DefaultInterface.Set_Red(pVal);
end;
function TXColorProperties.Get_Green: Integer;
begin
Result := DefaultInterface.Get_Green;
end;
procedure TXColorProperties.Set_Green(pVal: Integer);
begin
DefaultInterface.Set_Green(pVal);
end;
function TXColorProperties.Get_Blue: Integer;
begin
Result := DefaultInterface.Get_Blue;
end;
procedure TXColorProperties.Set_Blue(pVal: Integer);
begin
DefaultInterface.Set_Blue(pVal);
end;
function TXColorProperties.Get_COLORREF: Integer;
begin
Result := DefaultInterface.Get_COLORREF;
end;
procedure TXColorProperties.Set_COLORREF(pVal: Integer);
begin
DefaultInterface.Set_COLORREF(pVal);
end;
{$ENDIF}
procedure Register;
begin
RegisterComponents('ActiveX',[TPluginFolder, TImageforPlugIN, TXRect, TXColor]);
end;
end.
//大家能不能给我一些提示
//我该如何做
//我主要需要用到
// IOperation 和IPluginFolder
//需要如何去做
//还有,基本相同的代码(关于这个com),就两行
//vb可以用,delphi使用就报错,为什么
//大家要是能给我帮助
//分数不是问题
//谢谢
//CodeOFDelphi
Self.PluginFolder1.ScanAll:=True;
self.PluginFolder1.Path:=ExtractFilePath(Application.ExeName)+'Plugin/';
for i:=1 to self.PluginFolder1.Plugins.Count do
begin
Self.ComboBox1.Items.Add(Self.PluginFolder1.Plugins.Get_Name);
end;
//codeof vb
Private Sub Form_Load()
With tPlugin
.ScanAll = -True
.Path = App.Path & "/plugin"
End With
For i = 0 To tPlugin.Plugins.Count
Combo1.AddItem tPlugin.Plugins(i).Name
Next
End Sub
unit Achroma_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// PASTLWTR : $Revision: 1.88 $
// File generated on 2000-10-8 7:32:13 from Type Library described below.
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
// ************************************************************************ //
// Type Lib: C:/Program Files/ImageExpress/plugin.dll (1)
// IID/LCID: {D2BBB9E3-CDC4-45E4-BAC9-8362B67A91EF}/0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (C:/WINNT/System32/stdole2.tlb)
// (2) v4.0 StdVCL, (C:/WINNT/System32/STDVCL40.DLL)
// Errors:
// Hint: Member 'Type' of 'IPlugin' changed to 'Type_'
// Hint: Member 'String' of 'IXRect' changed to 'String_'
// Hint: Member 'String' of 'IXColor' changed to 'String_'
// Error creating palette bitmap of (TPluginFolder) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TImageforPlugIN) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TXRect) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// Error creating palette bitmap of (TXColor) : Server C:/PROGRA~1/IMAGEE~1/plugin.dll contains no icons
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
AchromaMajorVersion = 1;
AchromaMinorVersion = 0;
LIBID_Achroma: TGUID = '{D2BBB9E3-CDC4-45E4-BAC9-8362B67A91EF}';
DIID__IOperationEvents: TGUID = '{2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}';
DIID__IPluginFolderEvents: TGUID = '{C1497B5E-1824-4DE4-AD8E-0129791783FF}';
IID_IPluginFolder: TGUID = '{997AFF92-4E12-466A-8FD4-BCF6D088B73A}';
CLASS_PluginFolder: TGUID = '{D7C1F25D-B95F-4C74-BF3C-17B749623DDA}';
IID_IPlugins: TGUID = '{10B1E34E-3B32-45FC-848A-F695D712C6C4}';
IID_IPlugin: TGUID = '{1754BFBB-2548-4D07-A38F-E44E5680D15F}';
IID_IOperation: TGUID = '{5D14275E-EC14-4C89-9F34-D1A004054918}';
IID_IImage: TGUID = '{39975D21-D501-439C-8136-30EB653C0214}';
IID_IXRect: TGUID = '{918FDCE5-D8EA-4516-B045-434E062B5B5D}';
IID_IXColor: TGUID = '{46B2AB1D-30BE-493B-A293-51AF1BECB87E}';
CLASS_Plugin: TGUID = '{266B5026-F220-4284-8C7D-86A27B2D57D6}';
CLASS_Operation: TGUID = '{3209FE67-F314-4FFF-B5AD-16B95C4B0AB3}';
CLASS_Plugins: TGUID = '{8772236E-5A7B-4586-AC5B-16AE422EB5F5}';
CLASS_Image: TGUID = '{0B186389-1108-4B00-A304-99910D403BBD}';
CLASS_XRect: TGUID = '{1918E481-D4AB-4781-B3D3-D9B02470FFFB}';
CLASS_XColor: TGUID = '{C41944E7-F40D-4305-89E4-FFBAFEB50A53}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_IOperationEvents = dispinterface;
_IPluginFolderEvents = dispinterface;
IPluginFolder = interface;
IPluginFolderDisp = dispinterface;
IPlugins = interface;
IPluginsDisp = dispinterface;
IPlugin = interface;
IPluginDisp = dispinterface;
IOperation = interface;
IOperationDisp = dispinterface;
IImage = interface;
IImageDisp = dispinterface;
IXRect = interface;
IXRectDisp = dispinterface;
IXColor = interface;
IXColorDisp = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
PluginFolder = IPluginFolder;
Plugin = IPlugin;
Operation = IOperation;
Plugins = IPlugins;
Image = IImage;
XRect = IXRect;
XColor = IXColor;
// *********************************************************************//
// DispIntf: _IOperationEvents
// Flags: (4096) Dispatchable
// GUID: {2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}
// *********************************************************************//
_IOperationEvents = dispinterface
['{2EF1ACF1-08C9-436B-9B00-B27EAFC688CD}']
procedure Progress(done: Integer; total: Integer; var cncl: WordBool); dispid 1;
end;
// *********************************************************************//
// DispIntf: _IPluginFolderEvents
// Flags: (4096) Dispatchable
// GUID: {C1497B5E-1824-4DE4-AD8E-0129791783FF}
// *********************************************************************//
_IPluginFolderEvents = dispinterface
['{C1497B5E-1824-4DE4-AD8E-0129791783FF}']
procedure Progress(done: Integer; total: Integer; var cncl: WordBool); dispid 1;
end;
// *********************************************************************//
// Interface: IPluginFolder
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {997AFF92-4E12-466A-8FD4-BCF6D088B73A}
// *********************************************************************//
IPluginFolder = interface(IDispatch)
['{997AFF92-4E12-466A-8FD4-BCF6D088B73A}']
function Get_Path: WideString; safecall;
procedure Set_Path(const pVal: WideString); safecall;
function Get_MaxDepth: Integer; safecall;
procedure Set_MaxDepth(pVal: Integer); safecall;
function Get_ScanAll: WordBool; safecall;
procedure Set_ScanAll(pVal: WordBool); safecall;
function Get_Libraries: WideString; safecall;
procedure Set_Libraries(const pVal: WideString); safecall;
function Get_Plugins: IPlugins; safecall;
function Get_AvailableMemory: Integer; safecall;
function AutoDetect: WordBool; safecall;
function GetReadFormat(const inPath: WideString): IOperation; safecall;
function GetWriteFormat(const inPath: WideString): IOperation; safecall;
function GetFilter(const inName: WideString): IOperation; safecall;
function GetExport(const inName: WideString): IOperation; safecall;
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
property Plugins: IPlugins read Get_Plugins;
property AvailableMemory: Integer read Get_AvailableMemory;
end;
// *********************************************************************//
// DispIntf: IPluginFolderDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {997AFF92-4E12-466A-8FD4-BCF6D088B73A}
// *********************************************************************//
IPluginFolderDisp = dispinterface
['{997AFF92-4E12-466A-8FD4-BCF6D088B73A}']
property Path: WideString dispid 1;
property MaxDepth: Integer dispid 2;
property ScanAll: WordBool dispid 3;
property Libraries: WideString dispid 4;
property Plugins: IPlugins readonly dispid 5;
property AvailableMemory: Integer readonly dispid 6;
function AutoDetect: WordBool; dispid 7;
function GetReadFormat(const inPath: WideString): IOperation; dispid 8;
function GetWriteFormat(const inPath: WideString): IOperation; dispid 9;
function GetFilter(const inName: WideString): IOperation; dispid 10;
function GetExport(const inName: WideString): IOperation; dispid 11;
end;
// *********************************************************************//
// Interface: IPlugins
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {10B1E34E-3B32-45FC-848A-F695D712C6C4}
// *********************************************************************//
IPlugins = interface(IDispatch)
['{10B1E34E-3B32-45FC-848A-F695D712C6C4}']
function Get__NewEnum: IUnknown; safecall;
function Get_Item(inIndex: OleVariant): IPlugin; safecall;
function Get_Count: Integer; safecall;
property _NewEnum: IUnknown read Get__NewEnum;
property Item[inIndex: OleVariant]: IPlugin read Get_Item; default;
property Count: Integer read Get_Count;
end;
// *********************************************************************//
// DispIntf: IPluginsDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {10B1E34E-3B32-45FC-848A-F695D712C6C4}
// *********************************************************************//
IPluginsDisp = dispinterface
['{10B1E34E-3B32-45FC-848A-F695D712C6C4}']
property _NewEnum: IUnknown readonly dispid -4;
property Item[inIndex: OleVariant]: IPlugin readonly dispid 0; default;
property Count: Integer readonly dispid 1;
end;
// *********************************************************************//
// Interface: IPlugin
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1754BFBB-2548-4D07-A38F-E44E5680D15F}
// *********************************************************************//
IPlugin = interface(IDispatch)
['{1754BFBB-2548-4D07-A38F-E44E5680D15F}']
function Get_Type_: WideString; safecall;
function Get_Name: WideString; safecall;
function Get_Category: WideString; safecall;
function Get_ClassName: WideString; safecall;
function Get_ClassDescription: WideString; safecall;
function Get_ReadTypes: WideString; safecall;
function Get_WriteTypes: WideString; safecall;
function Get_Scriptable: WordBool; safecall;
function Get_Path: WideString; safecall;
procedure ShowAboutBox; safecall;
property Type_: WideString read Get_Type_;
property Name: WideString read Get_Name;
property Category: WideString read Get_Category;
property ClassName: WideString read Get_ClassName;
property ClassDescription: WideString read Get_ClassDescription;
property ReadTypes: WideString read Get_ReadTypes;
property WriteTypes: WideString read Get_WriteTypes;
property Scriptable: WordBool read Get_Scriptable;
property Path: WideString read Get_Path;
end;
// *********************************************************************//
// DispIntf: IPluginDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {1754BFBB-2548-4D07-A38F-E44E5680D15F}
// *********************************************************************//
IPluginDisp = dispinterface
['{1754BFBB-2548-4D07-A38F-E44E5680D15F}']
property Type_: WideString readonly dispid 1;
property Name: WideString readonly dispid 2;
property Category: WideString readonly dispid 3;
property ClassName: WideString readonly dispid 4;
property ClassDescription: WideString readonly dispid 5;
property ReadTypes: WideString readonly dispid 6;
property WriteTypes: WideString readonly dispid 7;
property Scriptable: WordBool readonly dispid 8;
property Path: WideString readonly dispid 9;
procedure ShowAboutBox; dispid 10;
end;
// *********************************************************************//
// Interface: IOperation
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {5D14275E-EC14-4C89-9F34-D1A004054918}
// *********************************************************************//
IOperation = interface(IDispatch)
['{5D14275E-EC14-4C89-9F34-D1A004054918}']
function Get_Kind: WideString; safecall;
function Get_Plugin: IPlugin; safecall;
function Get_Image: IImage; safecall;
procedure Set_Image(const pVal: IImage); safecall;
function Get_Selection: IImage; safecall;
procedure Set_Selection(const pVal: IImage); safecall;
function Get_Path: WideString; safecall;
procedure Set_Path(const pVal: WideString); safecall;
function Get_TextScript: WideString; safecall;
procedure Set_TextScript(const pVal: WideString); safecall;
function Get_Silent: WordBool; safecall;
procedure Set_Silent(pVal: WordBool); safecall;
function Get_SelectionRect: IXRect; safecall;
procedure Set_SelectionRect(const pVal: IXRect); safecall;
function Get_SelectedOutside: WordBool; safecall;
procedure Set_SelectedOutside(pVal: WordBool); safecall;
function Get_ForeColor: IXColor; safecall;
procedure Set_ForeColor(const pVal: IXColor); safecall;
function Get_BackColor: IXColor; safecall;
procedure Set_BackColor(const pVal: IXColor); safecall;
function Get_Cancelled: WordBool; safecall;
procedure DoIt; safecall;
property Kind: WideString read Get_Kind;
property Plugin: IPlugin read Get_Plugin;
property Image: IImage read Get_Image write Set_Image;
property Selection: IImage read Get_Selection write Set_Selection;
property Path: WideString read Get_Path write Set_Path;
property TextScript: WideString read Get_TextScript write Set_TextScript;
property Silent: WordBool read Get_Silent write Set_Silent;
property SelectionRect: IXRect read Get_SelectionRect write Set_SelectionRect;
property SelectedOutside: WordBool read Get_SelectedOutside write Set_SelectedOutside;
property ForeColor: IXColor read Get_ForeColor write Set_ForeColor;
property BackColor: IXColor read Get_BackColor write Set_BackColor;
property Cancelled: WordBool read Get_Cancelled;
end;
// *********************************************************************//
// DispIntf: IOperationDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {5D14275E-EC14-4C89-9F34-D1A004054918}
// *********************************************************************//
IOperationDisp = dispinterface
['{5D14275E-EC14-4C89-9F34-D1A004054918}']
property Kind: WideString readonly dispid 1;
property Plugin: IPlugin readonly dispid 2;
property Image: IImage dispid 3;
property Selection: IImage dispid 4;
property Path: WideString dispid 5;
property TextScript: WideString dispid 6;
property Silent: WordBool dispid 7;
property SelectionRect: IXRect dispid 8;
property SelectedOutside: WordBool dispid 9;
property ForeColor: IXColor dispid 10;
property BackColor: IXColor dispid 11;
property Cancelled: WordBool readonly dispid 12;
procedure DoIt; dispid 13;
end;
// *********************************************************************//
// Interface: IImage
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {39975D21-D501-439C-8136-30EB653C0214}
// *********************************************************************//
IImage = interface(IDispatch)
['{39975D21-D501-439C-8136-30EB653C0214}']
function Get_Width: Integer; safecall;
function Get_Height: Integer; safecall;
function Get_Bitmap: Integer; safecall;
procedure Set_Bitmap(pVal: Integer); safecall;
function Get_OwnsBitmap: WordBool; safecall;
procedure Set_OwnsBitmap(pVal: WordBool); safecall;
function Get_Palette: Integer; safecall;
procedure Set_Palette(pVal: Integer); safecall;
function Get_OwnsPalette: WordBool; safecall;
procedure Set_OwnsPalette(pVal: WordBool); safecall;
function Get_Picture: IPicture; safecall;
procedure Set_Picture(const pVal: IPicture); safecall;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
end;
// *********************************************************************//
// DispIntf: IImageDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {39975D21-D501-439C-8136-30EB653C0214}
// *********************************************************************//
IImageDisp = dispinterface
['{39975D21-D501-439C-8136-30EB653C0214}']
property Width: Integer readonly dispid 1;
property Height: Integer readonly dispid 2;
property Bitmap: Integer dispid 3;
property OwnsBitmap: WordBool dispid 4;
property Palette: Integer dispid 5;
property OwnsPalette: WordBool dispid 6;
property Picture: IPicture dispid 7;
end;
// *********************************************************************//
// Interface: IXRect
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {918FDCE5-D8EA-4516-B045-434E062B5B5D}
// *********************************************************************//
IXRect = interface(IDispatch)
['{918FDCE5-D8EA-4516-B045-434E062B5B5D}']
function Get_String_: WideString; safecall;
procedure Set_String_(const pVal: WideString); safecall;
function Get_Top: Integer; safecall;
procedure Set_Top(pVal: Integer); safecall;
function Get_Left: Integer; safecall;
procedure Set_Left(pVal: Integer); safecall;
function Get_Bottom: Integer; safecall;
procedure Set_Bottom(pVal: Integer); safecall;
function Get_Right: Integer; safecall;
procedure Set_Right(pVal: Integer); safecall;
function Get_Width: Integer; safecall;
function Get_Height: Integer; safecall;
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
end;
// *********************************************************************//
// DispIntf: IXRectDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {918FDCE5-D8EA-4516-B045-434E062B5B5D}
// *********************************************************************//
IXRectDisp = dispinterface
['{918FDCE5-D8EA-4516-B045-434E062B5B5D}']
property String_: WideString dispid 0;
property Top: Integer dispid 1;
property Left: Integer dispid 2;
property Bottom: Integer dispid 3;
property Right: Integer dispid 4;
property Width: Integer readonly dispid 5;
property Height: Integer readonly dispid 6;
end;
// *********************************************************************//
// Interface: IXColor
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {46B2AB1D-30BE-493B-A293-51AF1BECB87E}
// *********************************************************************//
IXColor = interface(IDispatch)
['{46B2AB1D-30BE-493B-A293-51AF1BECB87E}']
function Get_String_: WideString; safecall;
procedure Set_String_(const pVal: WideString); safecall;
function Get_Red: Integer; safecall;
procedure Set_Red(pVal: Integer); safecall;
function Get_Green: Integer; safecall;
procedure Set_Green(pVal: Integer); safecall;
function Get_Blue: Integer; safecall;
procedure Set_Blue(pVal: Integer); safecall;
function Get_COLORREF: Integer; safecall;
procedure Set_COLORREF(pVal: Integer); safecall;
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
end;
// *********************************************************************//
// DispIntf: IXColorDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {46B2AB1D-30BE-493B-A293-51AF1BECB87E}
// *********************************************************************//
IXColorDisp = dispinterface
['{46B2AB1D-30BE-493B-A293-51AF1BECB87E}']
property String_: WideString dispid 0;
property Red: Integer dispid 1;
property Green: Integer dispid 2;
property Blue: Integer dispid 3;
property COLORREF: Integer dispid 4;
end;
// *********************************************************************//
// The Class CoPluginFolder provides a Create and CreateRemote method to
// create instances of the default interface IPluginFolder exposed by
// the CoClass PluginFolder. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPluginFolder = class
class function Create: IPluginFolder;
class function CreateRemote(const MachineName: string): IPluginFolder;
end;
TPluginFolderProgress = procedure(Sender: TObject; done: Integer; total: Integer;
var cncl: OleVariant) of object;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TPluginFolder
// Help String : An object you can create to specify a plugin folder
// Default Interface: IPluginFolder
// Def. Intf. DISP? : No
// Event Interface: _IPluginFolderEvents
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TPluginFolderProperties= class;
{$ENDIF}
TPluginFolder = class(TOleServer)
private
FOnProgress: TPluginFolderProgress;
FIntf: IPluginFolder;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TPluginFolderProperties;
function GetServerProperties: TPluginFolderProperties;
{$ENDIF}
function GetDefaultInterface: IPluginFolder;
protected
procedure InitServerData; override;
procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
function Get_Path: WideString;
procedure Set_Path(const pVal: WideString);
function Get_MaxDepth: Integer;
procedure Set_MaxDepth(pVal: Integer);
function Get_ScanAll: WordBool;
procedure Set_ScanAll(pVal: WordBool);
function Get_Libraries: WideString;
procedure Set_Libraries(const pVal: WideString);
function Get_Plugins: IPlugins;
function Get_AvailableMemory: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IPluginFolder);
procedure Disconnect; override;
function AutoDetect: WordBool;
function GetReadFormat(const inPath: WideString): IOperation;
function GetWriteFormat(const inPath: WideString): IOperation;
function GetFilter(const inName: WideString): IOperation;
function GetExport(const inName: WideString): IOperation;
property DefaultInterface: IPluginFolder read GetDefaultInterface;
property Plugins: IPlugins read Get_Plugins;
property AvailableMemory: Integer read Get_AvailableMemory;
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TPluginFolderProperties read GetServerProperties;
{$ENDIF}
property OnProgress: TPluginFolderProgress read FOnProgress write FOnProgress;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TPluginFolder
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TPluginFolderProperties = class(TPersistent)
private
FServer: TPluginFolder;
function GetDefaultInterface: IPluginFolder;
constructor Create(AServer: TPluginFolder);
protected
function Get_Path: WideString;
procedure Set_Path(const pVal: WideString);
function Get_MaxDepth: Integer;
procedure Set_MaxDepth(pVal: Integer);
function Get_ScanAll: WordBool;
procedure Set_ScanAll(pVal: WordBool);
function Get_Libraries: WideString;
procedure Set_Libraries(const pVal: WideString);
function Get_Plugins: IPlugins;
function Get_AvailableMemory: Integer;
public
property DefaultInterface: IPluginFolder read GetDefaultInterface;
published
property Path: WideString read Get_Path write Set_Path;
property MaxDepth: Integer read Get_MaxDepth write Set_MaxDepth;
property ScanAll: WordBool read Get_ScanAll write Set_ScanAll;
property Libraries: WideString read Get_Libraries write Set_Libraries;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoPlugin provides a Create and CreateRemote method to
// create instances of the default interface IPlugin exposed by
// the CoClass Plugin. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPlugin = class
class function Create: IPlugin;
class function CreateRemote(const MachineName: string): IPlugin;
end;
// *********************************************************************//
// The Class CoOperation provides a Create and CreateRemote method to
// create instances of the default interface IOperation exposed by
// the CoClass Operation. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoOperation = class
class function Create: IOperation;
class function CreateRemote(const MachineName: string): IOperation;
end;
// *********************************************************************//
// The Class CoPlugins provides a Create and CreateRemote method to
// create instances of the default interface IPlugins exposed by
// the CoClass Plugins. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoPlugins = class
class function Create: IPlugins;
class function CreateRemote(const MachineName: string): IPlugins;
end;
// *********************************************************************//
// The Class CoImage provides a Create and CreateRemote method to
// create instances of the default interface IImage exposed by
// the CoClass Image. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoImage = class
class function Create: IImage;
class function CreateRemote(const MachineName: string): IImage;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TImageforPlugIN
// Help String : An object to allow bitmap manipulation
// Default Interface: IImage
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TImageforPlugINProperties= class;
{$ENDIF}
TImageforPlugIN = class(TOleServer)
private
FIntf: IImage;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TImageforPlugINProperties;
function GetServerProperties: TImageforPlugINProperties;
{$ENDIF}
function GetDefaultInterface: IImage;
protected
procedure InitServerData; override;
function Get_Width: Integer;
function Get_Height: Integer;
function Get_Bitmap: Integer;
procedure Set_Bitmap(pVal: Integer);
function Get_OwnsBitmap: WordBool;
procedure Set_OwnsBitmap(pVal: WordBool);
function Get_Palette: Integer;
procedure Set_Palette(pVal: Integer);
function Get_OwnsPalette: WordBool;
procedure Set_OwnsPalette(pVal: WordBool);
function Get_Picture: IPicture;
procedure Set_Picture(const pVal: IPicture);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IImage);
procedure Disconnect; override;
property DefaultInterface: IImage read GetDefaultInterface;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TImageforPlugINProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TImageforPlugIN
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TImageforPlugINProperties = class(TPersistent)
private
FServer: TImageforPlugIN;
function GetDefaultInterface: IImage;
constructor Create(AServer: TImageforPlugIN);
protected
function Get_Width: Integer;
function Get_Height: Integer;
function Get_Bitmap: Integer;
procedure Set_Bitmap(pVal: Integer);
function Get_OwnsBitmap: WordBool;
procedure Set_OwnsBitmap(pVal: WordBool);
function Get_Palette: Integer;
procedure Set_Palette(pVal: Integer);
function Get_OwnsPalette: WordBool;
procedure Set_OwnsPalette(pVal: WordBool);
function Get_Picture: IPicture;
procedure Set_Picture(const pVal: IPicture);
public
property DefaultInterface: IImage read GetDefaultInterface;
published
property Bitmap: Integer read Get_Bitmap write Set_Bitmap;
property OwnsBitmap: WordBool read Get_OwnsBitmap write Set_OwnsBitmap;
property Palette: Integer read Get_Palette write Set_Palette;
property OwnsPalette: WordBool read Get_OwnsPalette write Set_OwnsPalette;
property Picture: IPicture read Get_Picture write Set_Picture;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoXRect provides a Create and CreateRemote method to
// create instances of the default interface IXRect exposed by
// the CoClass XRect. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoXRect = class
class function Create: IXRect;
class function CreateRemote(const MachineName: string): IXRect;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TXRect
// Help String : An object to describe a rectangle
// Default Interface: IXRect
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TXRectProperties= class;
{$ENDIF}
TXRect = class(TOleServer)
private
FIntf: IXRect;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TXRectProperties;
function GetServerProperties: TXRectProperties;
{$ENDIF}
function GetDefaultInterface: IXRect;
protected
procedure InitServerData; override;
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Top: Integer;
procedure Set_Top(pVal: Integer);
function Get_Left: Integer;
procedure Set_Left(pVal: Integer);
function Get_Bottom: Integer;
procedure Set_Bottom(pVal: Integer);
function Get_Right: Integer;
procedure Set_Right(pVal: Integer);
function Get_Width: Integer;
function Get_Height: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IXRect);
procedure Disconnect; override;
property DefaultInterface: IXRect read GetDefaultInterface;
property Width: Integer read Get_Width;
property Height: Integer read Get_Height;
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TXRectProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TXRect
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TXRectProperties = class(TPersistent)
private
FServer: TXRect;
function GetDefaultInterface: IXRect;
constructor Create(AServer: TXRect);
protected
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Top: Integer;
procedure Set_Top(pVal: Integer);
function Get_Left: Integer;
procedure Set_Left(pVal: Integer);
function Get_Bottom: Integer;
procedure Set_Bottom(pVal: Integer);
function Get_Right: Integer;
procedure Set_Right(pVal: Integer);
function Get_Width: Integer;
function Get_Height: Integer;
public
property DefaultInterface: IXRect read GetDefaultInterface;
published
property String_: WideString read Get_String_ write Set_String_;
property Top: Integer read Get_Top write Set_Top;
property Left: Integer read Get_Left write Set_Left;
property Bottom: Integer read Get_Bottom write Set_Bottom;
property Right: Integer read Get_Right write Set_Right;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoXColor provides a Create and CreateRemote method to
// create instances of the default interface IXColor exposed by
// the CoClass XColor. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoXColor = class
class function Create: IXColor;
class function CreateRemote(const MachineName: string): IXColor;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TXColor
// Help String : An object to describe a color
// Default Interface: IXColor
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TXColorProperties= class;
{$ENDIF}
TXColor = class(TOleServer)
private
FIntf: IXColor;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TXColorProperties;
function GetServerProperties: TXColorProperties;
{$ENDIF}
function GetDefaultInterface: IXColor;
protected
procedure InitServerData; override;
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Red: Integer;
procedure Set_Red(pVal: Integer);
function Get_Green: Integer;
procedure Set_Green(pVal: Integer);
function Get_Blue: Integer;
procedure Set_Blue(pVal: Integer);
function Get_COLORREF: Integer;
procedure Set_COLORREF(pVal: Integer);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IXColor);
procedure Disconnect; override;
property DefaultInterface: IXColor read GetDefaultInterface;
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TXColorProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TXColor
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TXColorProperties = class(TPersistent)
private
FServer: TXColor;
function GetDefaultInterface: IXColor;
constructor Create(AServer: TXColor);
protected
function Get_String_: WideString;
procedure Set_String_(const pVal: WideString);
function Get_Red: Integer;
procedure Set_Red(pVal: Integer);
function Get_Green: Integer;
procedure Set_Green(pVal: Integer);
function Get_Blue: Integer;
procedure Set_Blue(pVal: Integer);
function Get_COLORREF: Integer;
procedure Set_COLORREF(pVal: Integer);
public
property DefaultInterface: IXColor read GetDefaultInterface;
published
property String_: WideString read Get_String_ write Set_String_;
property Red: Integer read Get_Red write Set_Red;
property Green: Integer read Get_Green write Set_Green;
property Blue: Integer read Get_Blue write Set_Blue;
property COLORREF: Integer read Get_COLORREF write Set_COLORREF;
end;
{$ENDIF}
procedure Register;
implementation
uses ComObj;
class function CoPluginFolder.Create: IPluginFolder;
begin
Result := CreateComObject(CLASS_PluginFolder) as IPluginFolder;
end;
class function CoPluginFolder.CreateRemote(const MachineName: string): IPluginFolder;
begin
Result := CreateRemoteComObject(MachineName, CLASS_PluginFolder) as IPluginFolder;
end;
procedure TPluginFolder.InitServerData;
const
CServerData: TServerData = (
ClassID: '{D7C1F25D-B95F-4C74-BF3C-17B749623DDA}';
IntfIID: '{997AFF92-4E12-466A-8FD4-BCF6D088B73A}';
EventIID: '{C1497B5E-1824-4DE4-AD8E-0129791783FF}';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TPluginFolder.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
ConnectEvents(punk);
Fintf:= punk as IPluginFolder;
end;
end;
procedure TPluginFolder.ConnectTo(svrIntf: IPluginFolder);
begin
Disconnect;
FIntf := svrIntf;
ConnectEvents(FIntf);
end;
procedure TPluginFolder.DisConnect;
begin
if Fintf <> nil then
begin
DisconnectEvents(FIntf);
FIntf := nil;
end;
end;
function TPluginFolder.GetDefaultInterface: IPluginFolder;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TPluginFolder.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TPluginFolderProperties.Create(Self);
{$ENDIF}
end;
destructor TPluginFolder.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TPluginFolder.GetServerProperties: TPluginFolderProperties;
begin
Result := FProps;
end;
{$ENDIF}
procedure TPluginFolder.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
case DispID of
-1: Exit; // DISPID_UNKNOWN
1: if Assigned(FOnProgress) then
FOnProgress(Self, Params[0] {Integer}, Params[1] {Integer}, Params[2] {var WordBool});
end; {case DispID}
end;
function TPluginFolder.Get_Path: WideString;
begin
Result := DefaultInterface.Get_Path;
end;
procedure TPluginFolder.Set_Path(const pVal: WideString);
begin
DefaultInterface.Set_Path(pVal);
end;
function TPluginFolder.Get_MaxDepth: Integer;
begin
Result := DefaultInterface.Get_MaxDepth;
end;
procedure TPluginFolder.Set_MaxDepth(pVal: Integer);
begin
DefaultInterface.Set_MaxDepth(pVal);
end;
function TPluginFolder.Get_ScanAll: WordBool;
begin
Result := DefaultInterface.Get_ScanAll;
end;
procedure TPluginFolder.Set_ScanAll(pVal: WordBool);
begin
DefaultInterface.Set_ScanAll(pVal);
end;
function TPluginFolder.Get_Libraries: WideString;
begin
Result := DefaultInterface.Get_Libraries;
end;
procedure TPluginFolder.Set_Libraries(const pVal: WideString);
begin
DefaultInterface.Set_Libraries(pVal);
end;
function TPluginFolder.Get_Plugins: IPlugins;
begin
Result := DefaultInterface.Get_Plugins;
end;
function TPluginFolder.Get_AvailableMemory: Integer;
begin
Result := DefaultInterface.Get_AvailableMemory;
end;
function TPluginFolder.AutoDetect: WordBool;
begin
Result := DefaultInterface.AutoDetect;
end;
function TPluginFolder.GetReadFormat(const inPath: WideString): IOperation;
begin
Result := DefaultInterface.GetReadFormat(inPath);
end;
function TPluginFolder.GetWriteFormat(const inPath: WideString): IOperation;
begin
Result := DefaultInterface.GetWriteFormat(inPath);
end;
function TPluginFolder.GetFilter(const inName: WideString): IOperation;
begin
Result := DefaultInterface.GetFilter(inName);
end;
function TPluginFolder.GetExport(const inName: WideString): IOperation;
begin
Result := DefaultInterface.GetExport(inName);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TPluginFolderProperties.Create(AServer: TPluginFolder);
begin
inherited Create;
FServer := AServer;
end;
function TPluginFolderProperties.GetDefaultInterface: IPluginFolder;
begin
Result := FServer.DefaultInterface;
end;
function TPluginFolderProperties.Get_Path: WideString;
begin
Result := DefaultInterface.Get_Path;
end;
procedure TPluginFolderProperties.Set_Path(const pVal: WideString);
begin
DefaultInterface.Set_Path(pVal);
end;
function TPluginFolderProperties.Get_MaxDepth: Integer;
begin
Result := DefaultInterface.Get_MaxDepth;
end;
procedure TPluginFolderProperties.Set_MaxDepth(pVal: Integer);
begin
DefaultInterface.Set_MaxDepth(pVal);
end;
function TPluginFolderProperties.Get_ScanAll: WordBool;
begin
Result := DefaultInterface.Get_ScanAll;
end;
procedure TPluginFolderProperties.Set_ScanAll(pVal: WordBool);
begin
DefaultInterface.Set_ScanAll(pVal);
end;
function TPluginFolderProperties.Get_Libraries: WideString;
begin
Result := DefaultInterface.Get_Libraries;
end;
procedure TPluginFolderProperties.Set_Libraries(const pVal: WideString);
begin
DefaultInterface.Set_Libraries(pVal);
end;
function TPluginFolderProperties.Get_Plugins: IPlugins;
begin
Result := DefaultInterface.Get_Plugins;
end;
function TPluginFolderProperties.Get_AvailableMemory: Integer;
begin
Result := DefaultInterface.Get_AvailableMemory;
end;
{$ENDIF}
class function CoPlugin.Create: IPlugin;
begin
Result := CreateComObject(CLASS_Plugin) as IPlugin;
end;
class function CoPlugin.CreateRemote(const MachineName: string): IPlugin;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Plugin) as IPlugin;
end;
class function CoOperation.Create: IOperation;
begin
Result := CreateComObject(CLASS_Operation) as IOperation;
end;
class function CoOperation.CreateRemote(const MachineName: string): IOperation;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Operation) as IOperation;
end;
class function CoPlugins.Create: IPlugins;
begin
Result := CreateComObject(CLASS_Plugins) as IPlugins;
end;
class function CoPlugins.CreateRemote(const MachineName: string): IPlugins;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Plugins) as IPlugins;
end;
class function CoImage.Create: IImage;
begin
Result := CreateComObject(CLASS_Image) as IImage;
end;
class function CoImage.CreateRemote(const MachineName: string): IImage;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Image) as IImage;
end;
procedure TImageforPlugIN.InitServerData;
const
CServerData: TServerData = (
ClassID: '{0B186389-1108-4B00-A304-99910D403BBD}';
IntfIID: '{39975D21-D501-439C-8136-30EB653C0214}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TImageforPlugIN.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IImage;
end;
end;
procedure TImageforPlugIN.ConnectTo(svrIntf: IImage);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TImageforPlugIN.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TImageforPlugIN.GetDefaultInterface: IImage;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TImageforPlugIN.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TImageforPlugINProperties.Create(Self);
{$ENDIF}
end;
destructor TImageforPlugIN.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TImageforPlugIN.GetServerProperties: TImageforPlugINProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TImageforPlugIN.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TImageforPlugIN.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
function TImageforPlugIN.Get_Bitmap: Integer;
begin
Result := DefaultInterface.Get_Bitmap;
end;
procedure TImageforPlugIN.Set_Bitmap(pVal: Integer);
begin
DefaultInterface.Set_Bitmap(pVal);
end;
function TImageforPlugIN.Get_OwnsBitmap: WordBool;
begin
Result := DefaultInterface.Get_OwnsBitmap;
end;
procedure TImageforPlugIN.Set_OwnsBitmap(pVal: WordBool);
begin
DefaultInterface.Set_OwnsBitmap(pVal);
end;
function TImageforPlugIN.Get_Palette: Integer;
begin
Result := DefaultInterface.Get_Palette;
end;
procedure TImageforPlugIN.Set_Palette(pVal: Integer);
begin
DefaultInterface.Set_Palette(pVal);
end;
function TImageforPlugIN.Get_OwnsPalette: WordBool;
begin
Result := DefaultInterface.Get_OwnsPalette;
end;
procedure TImageforPlugIN.Set_OwnsPalette(pVal: WordBool);
begin
DefaultInterface.Set_OwnsPalette(pVal);
end;
function TImageforPlugIN.Get_Picture: IPicture;
begin
Result := DefaultInterface.Get_Picture;
end;
procedure TImageforPlugIN.Set_Picture(const pVal: IPicture);
begin
DefaultInterface.Set_Picture(pVal);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TImageforPlugINProperties.Create(AServer: TImageforPlugIN);
begin
inherited Create;
FServer := AServer;
end;
function TImageforPlugINProperties.GetDefaultInterface: IImage;
begin
Result := FServer.DefaultInterface;
end;
function TImageforPlugINProperties.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TImageforPlugINProperties.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
function TImageforPlugINProperties.Get_Bitmap: Integer;
begin
Result := DefaultInterface.Get_Bitmap;
end;
procedure TImageforPlugINProperties.Set_Bitmap(pVal: Integer);
begin
DefaultInterface.Set_Bitmap(pVal);
end;
function TImageforPlugINProperties.Get_OwnsBitmap: WordBool;
begin
Result := DefaultInterface.Get_OwnsBitmap;
end;
procedure TImageforPlugINProperties.Set_OwnsBitmap(pVal: WordBool);
begin
DefaultInterface.Set_OwnsBitmap(pVal);
end;
function TImageforPlugINProperties.Get_Palette: Integer;
begin
Result := DefaultInterface.Get_Palette;
end;
procedure TImageforPlugINProperties.Set_Palette(pVal: Integer);
begin
DefaultInterface.Set_Palette(pVal);
end;
function TImageforPlugINProperties.Get_OwnsPalette: WordBool;
begin
Result := DefaultInterface.Get_OwnsPalette;
end;
procedure TImageforPlugINProperties.Set_OwnsPalette(pVal: WordBool);
begin
DefaultInterface.Set_OwnsPalette(pVal);
end;
function TImageforPlugINProperties.Get_Picture: IPicture;
begin
Result := DefaultInterface.Get_Picture;
end;
procedure TImageforPlugINProperties.Set_Picture(const pVal: IPicture);
begin
DefaultInterface.Set_Picture(pVal);
end;
{$ENDIF}
class function CoXRect.Create: IXRect;
begin
Result := CreateComObject(CLASS_XRect) as IXRect;
end;
class function CoXRect.CreateRemote(const MachineName: string): IXRect;
begin
Result := CreateRemoteComObject(MachineName, CLASS_XRect) as IXRect;
end;
procedure TXRect.InitServerData;
const
CServerData: TServerData = (
ClassID: '{1918E481-D4AB-4781-B3D3-D9B02470FFFB}';
IntfIID: '{918FDCE5-D8EA-4516-B045-434E062B5B5D}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TXRect.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IXRect;
end;
end;
procedure TXRect.ConnectTo(svrIntf: IXRect);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TXRect.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TXRect.GetDefaultInterface: IXRect;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TXRect.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TXRectProperties.Create(Self);
{$ENDIF}
end;
destructor TXRect.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TXRect.GetServerProperties: TXRectProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TXRect.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXRect.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXRect.Get_Top: Integer;
begin
Result := DefaultInterface.Get_Top;
end;
procedure TXRect.Set_Top(pVal: Integer);
begin
DefaultInterface.Set_Top(pVal);
end;
function TXRect.Get_Left: Integer;
begin
Result := DefaultInterface.Get_Left;
end;
procedure TXRect.Set_Left(pVal: Integer);
begin
DefaultInterface.Set_Left(pVal);
end;
function TXRect.Get_Bottom: Integer;
begin
Result := DefaultInterface.Get_Bottom;
end;
procedure TXRect.Set_Bottom(pVal: Integer);
begin
DefaultInterface.Set_Bottom(pVal);
end;
function TXRect.Get_Right: Integer;
begin
Result := DefaultInterface.Get_Right;
end;
procedure TXRect.Set_Right(pVal: Integer);
begin
DefaultInterface.Set_Right(pVal);
end;
function TXRect.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TXRect.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TXRectProperties.Create(AServer: TXRect);
begin
inherited Create;
FServer := AServer;
end;
function TXRectProperties.GetDefaultInterface: IXRect;
begin
Result := FServer.DefaultInterface;
end;
function TXRectProperties.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXRectProperties.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXRectProperties.Get_Top: Integer;
begin
Result := DefaultInterface.Get_Top;
end;
procedure TXRectProperties.Set_Top(pVal: Integer);
begin
DefaultInterface.Set_Top(pVal);
end;
function TXRectProperties.Get_Left: Integer;
begin
Result := DefaultInterface.Get_Left;
end;
procedure TXRectProperties.Set_Left(pVal: Integer);
begin
DefaultInterface.Set_Left(pVal);
end;
function TXRectProperties.Get_Bottom: Integer;
begin
Result := DefaultInterface.Get_Bottom;
end;
procedure TXRectProperties.Set_Bottom(pVal: Integer);
begin
DefaultInterface.Set_Bottom(pVal);
end;
function TXRectProperties.Get_Right: Integer;
begin
Result := DefaultInterface.Get_Right;
end;
procedure TXRectProperties.Set_Right(pVal: Integer);
begin
DefaultInterface.Set_Right(pVal);
end;
function TXRectProperties.Get_Width: Integer;
begin
Result := DefaultInterface.Get_Width;
end;
function TXRectProperties.Get_Height: Integer;
begin
Result := DefaultInterface.Get_Height;
end;
{$ENDIF}
class function CoXColor.Create: IXColor;
begin
Result := CreateComObject(CLASS_XColor) as IXColor;
end;
class function CoXColor.CreateRemote(const MachineName: string): IXColor;
begin
Result := CreateRemoteComObject(MachineName, CLASS_XColor) as IXColor;
end;
procedure TXColor.InitServerData;
const
CServerData: TServerData = (
ClassID: '{C41944E7-F40D-4305-89E4-FFBAFEB50A53}';
IntfIID: '{46B2AB1D-30BE-493B-A293-51AF1BECB87E}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TXColor.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IXColor;
end;
end;
procedure TXColor.ConnectTo(svrIntf: IXColor);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TXColor.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TXColor.GetDefaultInterface: IXColor;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;
constructor TXColor.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TXColorProperties.Create(Self);
{$ENDIF}
end;
destructor TXColor.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TXColor.GetServerProperties: TXColorProperties;
begin
Result := FProps;
end;
{$ENDIF}
function TXColor.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXColor.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXColor.Get_Red: Integer;
begin
Result := DefaultInterface.Get_Red;
end;
procedure TXColor.Set_Red(pVal: Integer);
begin
DefaultInterface.Set_Red(pVal);
end;
function TXColor.Get_Green: Integer;
begin
Result := DefaultInterface.Get_Green;
end;
procedure TXColor.Set_Green(pVal: Integer);
begin
DefaultInterface.Set_Green(pVal);
end;
function TXColor.Get_Blue: Integer;
begin
Result := DefaultInterface.Get_Blue;
end;
procedure TXColor.Set_Blue(pVal: Integer);
begin
DefaultInterface.Set_Blue(pVal);
end;
function TXColor.Get_COLORREF: Integer;
begin
Result := DefaultInterface.Get_COLORREF;
end;
procedure TXColor.Set_COLORREF(pVal: Integer);
begin
DefaultInterface.Set_COLORREF(pVal);
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TXColorProperties.Create(AServer: TXColor);
begin
inherited Create;
FServer := AServer;
end;
function TXColorProperties.GetDefaultInterface: IXColor;
begin
Result := FServer.DefaultInterface;
end;
function TXColorProperties.Get_String_: WideString;
begin
Result := DefaultInterface.Get_String_;
end;
procedure TXColorProperties.Set_String_(const pVal: WideString);
begin
DefaultInterface.Set_String_(pVal);
end;
function TXColorProperties.Get_Red: Integer;
begin
Result := DefaultInterface.Get_Red;
end;
procedure TXColorProperties.Set_Red(pVal: Integer);
begin
DefaultInterface.Set_Red(pVal);
end;
function TXColorProperties.Get_Green: Integer;
begin
Result := DefaultInterface.Get_Green;
end;
procedure TXColorProperties.Set_Green(pVal: Integer);
begin
DefaultInterface.Set_Green(pVal);
end;
function TXColorProperties.Get_Blue: Integer;
begin
Result := DefaultInterface.Get_Blue;
end;
procedure TXColorProperties.Set_Blue(pVal: Integer);
begin
DefaultInterface.Set_Blue(pVal);
end;
function TXColorProperties.Get_COLORREF: Integer;
begin
Result := DefaultInterface.Get_COLORREF;
end;
procedure TXColorProperties.Set_COLORREF(pVal: Integer);
begin
DefaultInterface.Set_COLORREF(pVal);
end;
{$ENDIF}
procedure Register;
begin
RegisterComponents('ActiveX',[TPluginFolder, TImageforPlugIN, TXRect, TXColor]);
end;
end.