2006-05-30 16:23:25 +02:00
|
|
|
{ compiletime ComObj support }
|
|
|
|
unit uPSC_comobj;
|
|
|
|
|
|
|
|
{$I PascalScript.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
|
|
uPSCompiler, uPSUtils;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Will register:
|
|
|
|
|
2008-10-09 21:03:33 +02:00
|
|
|
function CreateOleObject(const ClassName: String): IDispatch;
|
|
|
|
function GetActiveOleObject(const ClassName: String): IDispatch;
|
2006-05-30 16:23:25 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
procedure SIRegister_ComObj(cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
procedure SIRegister_ComObj(cl: TPSPascalCompiler);
|
|
|
|
begin
|
2014-05-19 10:11:51 +02:00
|
|
|
{$IFDEF FPC}
|
|
|
|
{$IFDEF PS_FPC_HAS_COM}
|
|
|
|
cl.AddTypeS('HResult', 'LongInt');
|
|
|
|
cl.AddTypeS('TGUID', 'record D1: LongWord; D2: Word; D3: Word; D4: array[0..7] of Byte; end;');
|
|
|
|
cl.AddTypeS('TCLSID', 'TGUID');
|
|
|
|
cl.AddTypeS('TIID', 'TGUID');
|
|
|
|
cl.AddDelphiFunction('procedure OleCheck(Result: HResult);');
|
|
|
|
cl.AddDelphiFunction('function StringToGUID(const S: string): TGUID;');
|
|
|
|
cl.AddDelphiFunction('function CreateComObject(const ClassID: TGUID): IUnknown;');
|
2016-05-13 14:34:11 +02:00
|
|
|
cl.AddDelphiFunction('function CreateOleObject(const ClassName: string): IDispatch;');
|
|
|
|
cl.AddDelphiFunction('function GetActiveOleObject(const ClassName: string): IDispatch;');
|
2014-05-19 10:11:51 +02:00
|
|
|
{$ENDIF}
|
|
|
|
{$ELSE}
|
2009-09-25 15:47:54 +02:00
|
|
|
cl.AddTypeS('HResult', 'LongInt');
|
2009-09-24 21:13:45 +02:00
|
|
|
cl.AddTypeS('TGUID', 'record D1: LongWord; D2: Word; D3: Word; D4: array[0..7] of Byte; end;');
|
2009-09-25 15:47:54 +02:00
|
|
|
cl.AddTypeS('TCLSID', 'TGUID');
|
|
|
|
cl.AddTypeS('TIID', 'TGUID');
|
2009-10-05 17:06:10 +02:00
|
|
|
cl.AddDelphiFunction('procedure OleCheck(Result: HResult);');
|
2009-09-24 21:13:45 +02:00
|
|
|
{$IFNDEF PS_NOINTERFACES}
|
|
|
|
{$IFDEF DELPHI3UP}
|
|
|
|
cl.AddDelphiFunction('function StringToGUID(const S: string): TGUID;');
|
|
|
|
cl.AddDelphiFunction('function CreateComObject(const ClassID: TGUID): IUnknown;');
|
|
|
|
{$ENDIF}
|
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
cl.AddDelphiFunction('function CreateOleObject(const ClassName: string): IDispatch;');
|
|
|
|
cl.AddDelphiFunction('function GetActiveOleObject(const ClassName: string): IDispatch;');
|
2014-05-19 10:11:51 +02:00
|
|
|
{$ENDIF}
|
2006-05-30 16:23:25 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|