mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 04:30:35 +01:00
* Patch by Ludo:
- Added the optional creation of a lazarus design/runtime package for the activex container. - Added full files in case diff doesn't work. Fixes to typelib importer: - avoid duplicate enum members (translated to const) (Office10\MSWORD.OLB) - don't make TEventSink or TActiveXContainer descendants if interface does not descend from IDispatch (VBA6\VBE6EXT.OLB) - add type declaration for coclass interface pointing to default interface - fixed property setter for array properties - added typecasting for byref interface event parameters - typecasting workaround for pvarVal^ and pbstrVal^ "Can't take the address of constant expressions" error caused by var type mismatch OLEVariant <> Variant and POleStr<>WideString - reverted to the use of OLEVariant. POLEVariant isn't automatable in trunk but PVariant isn't automatable in 2.6.0 neither. - added byref VT_INT, VT_UINT, VT_DECIMAL event parameter support (Office10\MSWORD.OLB) - replace the use of TOleEnum with LongWord. Definition in ActiveX (type TOleEnum = type LongWord;) prohibits casting of OleVariant to TOleEnum.(Office10\MSOUTL.OLB) - disambiguate method name for INVOKE_PROPERTYPUT and INVOKE_PROPERTYPUTREF on same property (ado\msado25.tlb) - postpone interface declaration until full declaration of ancestor class. git-svn-id: trunk@20157 -
This commit is contained in:
parent
b9b960ebcf
commit
6182f2d25d
File diff suppressed because it is too large
Load Diff
@ -6,24 +6,25 @@ uses
|
||||
classes,typelib,sysutils;
|
||||
|
||||
var
|
||||
unitname:string;
|
||||
unitname,sPackageSource,sPackageRegUnitSource:string;
|
||||
sTL,sOutDir:string;
|
||||
F:text;
|
||||
slDep:TStringList;
|
||||
i:integer;
|
||||
bNoRecurse,bHelp, bActivex:boolean;
|
||||
|
||||
bNoRecurse,bHelp,bActiveX,bPackage:boolean;
|
||||
begin
|
||||
slDep:=TStringList.Create;
|
||||
bNoRecurse:=false;
|
||||
bHelp:=false;
|
||||
bActiveX:=false;
|
||||
bPackage:=false;
|
||||
i:=1;
|
||||
while i<=Paramcount do
|
||||
begin
|
||||
if pos('-n',ParamStr(i))>0 then bNoRecurse:=true
|
||||
else if pos('-a',ParamStr(i))>0 then bActiveX:=true
|
||||
else if pos('-h',ParamStr(i))>0 then bHelp:=true
|
||||
else if pos('-p',ParamStr(i))>0 then bPackage:=true
|
||||
else if pos('-d',ParamStr(i))>0 then
|
||||
begin
|
||||
sOutDir:=trim(copy(ParamStr(i), pos('-d',ParamStr(i))+2, 260)); // windows MAX_PATH
|
||||
@ -54,17 +55,32 @@ begin
|
||||
writeln(' -d dir: set output directory. Default: current directory.');
|
||||
writeln(' -n : do not recurse typelibs. Default: create bindingss for all');
|
||||
writeln(' dependencies.');
|
||||
writeln(' -p : create lazarus package for ActiveXContainer descendants');
|
||||
exit;
|
||||
end;
|
||||
slDep.Add(paramstr(Paramcount));
|
||||
i:=0;
|
||||
repeat
|
||||
writeln('Reading typelib from '+slDep[i]+ ' ...');
|
||||
sTL:=ImportTypelib(slDep[i],unitname,slDep,bActiveX);
|
||||
bActiveX:=false; //don't create ActiveXContainer descendants in descendants
|
||||
sTL:=ImportTypelib(slDep[i],unitname,slDep,bActiveX,bPackage,sPackageSource,sPackageRegUnitSource);
|
||||
unitname:=sOutDir+unitname;
|
||||
writeln('Writing to '+unitname);
|
||||
AssignFile(F,unitname);
|
||||
if (bPackage) and (sPackageSource<>'') then
|
||||
begin
|
||||
writeln('Writing package file to '+unitname+'P.lpk' );
|
||||
AssignFile(F,unitname+'P.lpk');
|
||||
Rewrite(F);
|
||||
Write(F,sPackageSource);
|
||||
CloseFile(F);
|
||||
writeln('Writing package registration file to '+unitname+'Preg.pas');
|
||||
AssignFile(F,unitname+'Preg.pas');
|
||||
Rewrite(F);
|
||||
Write(F,sPackageSource);
|
||||
CloseFile(F);
|
||||
end;
|
||||
bActiveX:=false; //don't create ActiveXContainer descendants in descendants
|
||||
bPackage:=false;
|
||||
writeln('Writing to '+unitname+'.pas');
|
||||
AssignFile(F,unitname+'.pas');
|
||||
Rewrite(F);
|
||||
Write(F,sTL);
|
||||
CloseFile(F);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user