views:

434

answers:

2

I can import a type library via tlibimp.exe, but when I open up the IDE, the libraries are not in the activex pallete. I can't seem to figure how to get it to install to a particular package either. In the IDE there is an install button in the Import Type Library dialog. How do I do this in the command line?

When I look in at the OCX.cpp file generated by tlibimp in the CBuilder5\Imports folder, I see "Errors: Error creating palette bitmap of (TTVBH3D) : No Server registered for this CoClass". Does this have something to do with the problem?


Edit:

I want to be able to install components to the activex palette without going through the IDE so that the process can be automated during a build. Any solutions must be able to be fully automated.

A: 

According to the parameter options of tlibimp.exe, there is a -Ha+ parameter which will "Generate IDE component wrappers for controls".

There is also a -Hr+ which generates the IDE registration for component wrappers.

Does supplying any of these parameters make any difference?

Not sure from this whether or not you then have to install the components using the generated registration code.

_J_
I found a forum where someone added:"Run TLIBIMP {name of your .ocx} with the "undocumented" -Yu option (We're uncertain what -Yu officially does, but the effect is that it makes your component(s) visible). You will want TLIBIMP to replace the files created when BCB installed the .OCX."
_J_
Further thoughts... I'm not sure you can do this from the one command. When you have the generated cpp files, the manual says to add them to the Borland User Package to install them on the Tool Palette. Maybe this needs to be done as a separate step, finally using BCC32.exe to recompile the package.
_J_
A: 

First, run tlibimp.exe (found under Program Files\Borland\C++Builder\Bin) with the ocx\dll you want to install.

Second, locate the cpp file generated by tlibimp (you can specify the output path with tlibimp) and find the string "Servers" at the bottom of the file and replace it with "ActiveX". This string determines the palette to install to. I'm not sure if this can be specified with tlibimp, but it doesn't look like it.

Next, compile the package that contains type library\activex component.

Finally, add a key to the registry. The key goes under HKCU\Software\Borland\C++Builder\5.0\Knownpackages. The name of the key should be the path to package that you just compiled (for example, $(BCB)\Bin\applet50.bpl).

When you open up BCB, you will see the components under the activex palette.

This is the only way I could find to do this that could be automated.

Everett