New Lazarus package integrating typelib importer and ActiveXContatiner in IDE
Original Reporter info from Mantis: ludob
-
Reporter name: Ludo Brands
Original Reporter info from Mantis: ludob
- Reporter name: Ludo Brands
Description:
The attached package does the following:
- add "import type library" to the Project menu
- add generic visual TActiveXContainer to the component palette in the ActiveX tab
Usage:
TActiveXContainer is a TWinControl descendant having the following additional properties:
property ClassName:string;
property ComServer:IDispatch;
property Active:boolean;
There are 2 ways to use the component, drop on a TActiveXContainer form and
- assign a class name to ClassName (f.e 'Shell.Explorer'), set Active to true: TActiveXContainer will create the com object with CreateOleObject, connect it to the TActiveXContainer window and return the interface in ComServer. Use ComServer to access the object with late binding. Setting Active to false destroys also the COM object.
- at run time, create a com object (CreateOleObject, call CoClass constructor,...) and assign the interface to ComServer. Set Active to true to connect the object to the TActiveXContainer window and false to disconnect it (no automatic destruction of the object). This is the typical use for early binding.
"import type library" opens a screen prompting the user for the typelib to import plus several options. The options correspond with the importtl tool options.
When a typelib is imported, eventually with dependencies, all created units will be opened in the current project as new files (not saved, not added to the project).
When a typelib is imported as a package, the user is prompted for a directory to store the new package (similar to "create new package"). The Name of the package is generated from the typelib and the package is opened when importing completed. The package contains the typelib with ActiveXContainer descendants created for dispatchable objects, including event handlers for these objects.
IMPORTANT. This package requires fpc trunk (backporting to 2.6.1 is on its way). Units typelib.pas and stdole2.pas are recently added to fpc.
Additional information:
This is my first IDE integration package. Probably some close review would be useful in that area ;)
Mantis conversion info:
- Mantis ID: 21138
- Version: 0.9.31 (SVN)
- Fixed in revision: 36802 (#bc03fa53)
- Monitored by: » BigChimp (Reinier Olislagers)