mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 17:29:33 +02:00
+ TTypedComObject
+ skeleton for TTypedComObjectFactory git-svn-id: trunk@10711 -
This commit is contained in:
parent
4e7e0f620a
commit
92b16f8876
@ -3094,14 +3094,16 @@ TYPE
|
|||||||
POleMenuGroupWidths = LPOLEMENUGROUPWIDTHS;
|
POleMenuGroupWidths = LPOLEMENUGROUPWIDTHS;
|
||||||
|
|
||||||
|
|
||||||
IProvideClassInfo = Interface (IUnknown)
|
IProvideClassInfo = Interface (IUnknown)
|
||||||
['{B196B283-BAB4-101A-B69C-00AA00341D07}']
|
['{B196B283-BAB4-101A-B69C-00AA00341D07}']
|
||||||
function GetClassInfo(out pptti : ITypeInfo):HResult; StdCall;
|
function GetClassInfo(out pptti : ITypeInfo):HResult; StdCall;
|
||||||
end;
|
end;
|
||||||
IProvideClassInfo2 = Interface (IProvideClassInfo)
|
|
||||||
['{A6BC3AC0-DBAA-11CE-9DE3-00AA004BB851}']
|
|
||||||
function GetGUID(dwguid:DWord;out pguid:TGUID):HResult; StdCall;
|
IProvideClassInfo2 = Interface (IProvideClassInfo)
|
||||||
end;
|
['{A6BC3AC0-DBAA-11CE-9DE3-00AA004BB851}']
|
||||||
|
function GetGUID(dwguid:DWord;out pguid:TGUID):HResult; StdCall;
|
||||||
|
end;
|
||||||
|
|
||||||
{ ******************************************************************************************************************
|
{ ******************************************************************************************************************
|
||||||
stuff from objbase.h
|
stuff from objbase.h
|
||||||
|
@ -175,6 +175,28 @@ unit comobj;
|
|||||||
property ThreadingModel: TThreadingModel read FThreadingModel;
|
property ThreadingModel: TThreadingModel read FThreadingModel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTypedComObject }
|
||||||
|
|
||||||
|
TTypedComObject = class(TComObject, IProvideClassInfo)
|
||||||
|
function GetClassInfo(out pptti : ITypeInfo):HResult; StdCall;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TTypedComClass = class of TTypedComObject;
|
||||||
|
|
||||||
|
{ TTypedComObjectFactory }
|
||||||
|
|
||||||
|
TTypedComObjectFactory = class(TComObjectFactory)
|
||||||
|
private
|
||||||
|
FClassInfo: ITypeInfo;
|
||||||
|
public
|
||||||
|
constructor Create(AComServer: TComServerObject; TypedComClass: TTypedComClass; const AClassID: TGUID;
|
||||||
|
AInstancing: TClassInstancing; AThreadingModel: TThreadingModel = tmSingle);
|
||||||
|
function GetInterfaceTypeInfo(TypeFlags: Integer) : ITypeInfo;
|
||||||
|
procedure UpdateRegistry(Register: Boolean);override;
|
||||||
|
property ClassInfo : ITypeInfo read FClassInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function CreateClassID : ansistring;
|
function CreateClassID : ansistring;
|
||||||
|
|
||||||
function CreateComObject(const ClassID: TGUID) : IUnknown;
|
function CreateComObject(const ClassID: TGUID) : IUnknown;
|
||||||
@ -1036,6 +1058,35 @@ implementation
|
|||||||
FreeMem(Arguments);
|
FreeMem(Arguments);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TTypedComObject }
|
||||||
|
|
||||||
|
function TTypedComObject.GetClassInfo(out pptti: ITypeInfo): HResult;stdcall;
|
||||||
|
begin
|
||||||
|
Result:=S_OK;
|
||||||
|
pptti:=TTypedComObjectFactory(factory).classinfo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TTypedComObjectFactory }
|
||||||
|
|
||||||
|
constructor TTypedComObjectFactory.Create(AComServer: TComServerObject; TypedComClass: TTypedComClass; const AClassID: TGUID;
|
||||||
|
AInstancing: TClassInstancing; AThreadingModel: TThreadingModel = tmSingle);
|
||||||
|
begin
|
||||||
|
RunError(217);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function TTypedComObjectFactory.GetInterfaceTypeInfo(TypeFlags: Integer): ITypeInfo;
|
||||||
|
begin
|
||||||
|
RunError(217);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TTypedComObjectFactory.UpdateRegistry(Register: Boolean);
|
||||||
|
begin
|
||||||
|
RunError(217);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
Initialized : boolean = false;
|
Initialized : boolean = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user