views:

471

answers:

2

What are the required flags for tlibimp.exe to properly mimic choosing 'Component -> Import ActiveX Control -> Install' in the Borland C++ Builder 5 IDE? I currently pass tlibimp an ocx and -L-, but there is a loss in funcionality when compared with results of importing it manually.

+1  A: 

The command line depends on what the IDE is attempting..for example install a component as active x.

-A TypeLibrary file suffix (defaults to '_TLB', -A- : no suffix) -D Output directory

-F TypeLibrary Output filename (extension ignored)

-N C++ namespace name -X OCX Wrappers Output filename (extension ignored - C++ only)

Switches: - (defaults are shown below)

-C- Generate C++ import file

-E+ Generate wrapper class for dispinterfaces (C++ only)

-G+ Expose namespace with 'using' statement

-H+ Generate IDE component wrappers for ActiveX Controls

-J- Generate CORBA IDL source file

-K- Generate Pascal CORBA Stubs and Skeletons

-L- Generate IDE component wrappers for OLE Servers

-O+ Generate CoClass Creator wrappers

-P+ Generate Pascal import file

-Q+ Generate 'Register' function for IDE components wrappers

-R+ Generate files for dependent typelibraries

-S+ Map HRESULT stdcall to safecall on dual interfaces (Delphi only)

-T- Map HRESULT stdcall to safecall on all interfaces (Delphi only)

-V- Generate Event wrappers for Server (C++ only)

-W+ Warnings in import file

-Yh Ignore the [Hidden] flag when importing

-Yr Ignore the [Restricted] flag when importing

-Yp Ignore the [PreDeclID] flag when importing

-Ya Combined -Yh -Yr -Yp

--

Michael

Michael
+1  A: 

It turns out that functionality loss was due to the fact that the ocx file I was importing was not registered. The projects that used this activeX control still compiled without a problem, but were still flawed. Registering the ocx with regsvr32 solved the problem.

Everett
I had the same trouble with tlibImp with Delphi 7, the COM object needs to be register so that the generation will work.
CheGueVerra