436967ea81
git-svn-id: http://code.remobjects.com/svn/pascalscript@186 5c9d2617-0215-0410-a2ee-e80e04d1c6d8
40 lines
1.1 KiB
ObjectPascal
40 lines
1.1 KiB
ObjectPascal
{ compiletime ComObj support }
|
|
unit uPSC_comobj;
|
|
|
|
{$I PascalScript.inc}
|
|
interface
|
|
uses
|
|
uPSCompiler, uPSUtils;
|
|
|
|
{
|
|
|
|
Will register:
|
|
|
|
function CreateOleObject(const ClassName: String): IDispatch;
|
|
function GetActiveOleObject(const ClassName: String): IDispatch;
|
|
|
|
}
|
|
|
|
procedure SIRegister_ComObj(cl: TPSPascalCompiler);
|
|
|
|
implementation
|
|
|
|
procedure SIRegister_ComObj(cl: TPSPascalCompiler);
|
|
begin
|
|
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);');
|
|
{$IFNDEF PS_NOINTERFACES}
|
|
{$IFDEF DELPHI3UP}
|
|
cl.AddDelphiFunction('function StringToGUID(const S: string): TGUID;');
|
|
cl.AddDelphiFunction('function CreateComObject(const ClassID: TGUID): IUnknown;');
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
cl.AddDelphiFunction('function CreateOleObject(const ClassName: String): IDispatch;');
|
|
cl.AddDelphiFunction('function GetActiveOleObject(const ClassName: String): IDispatch;');
|
|
end;
|
|
|
|
end.
|