Board index » cppbuilder » BCB6 and ActiveX import problem

BCB6 and ActiveX import problem

I evaluated BCB5 a long time ago and could not import an activex control
which was written in VB.  I was helped on this board and told to use the
command line as follows:

tlibimp -C+ -Yu -Ya -H+ -Q+ -R+ MyActiveX.ocx

that fixed me up.  Due to some problems with BCB5, we shelved BCB.  Now that
BCB6 is out, we are trying again.  The problem is I am trying to import the
same ActiveX control and install it, compile it into dclusr.bpk.  I install
it and it is successful.  The problem is it is in none of my pallettes.  I
tried to get the command line import to work but parameters changed so I
modified it to:

tlibimp -C+ -Yc- -Ha+ -Hr+ -R+ MyActiveX.OCX
Now it says "error loading type libraries" for my activeX control.

How do I import this ActiveX control?
Thanx

Robert H. Oujesky

 

Re:BCB6 and ActiveX import problem


Hi,

Quote
> How do I import this ActiveX control?

You could try the IDE switches found in Tools | Environment Options
| Type Library. Try turning all of the "Ignore special coClass flags"
switches ON.

--Craig

Re:BCB6 and ActiveX import problem


Craig:
Just tried that, but it did not help.  Does BCB typically have problems
importing ActiveX controls written in VB?  I am a real newbie, so I am a
little lost...  I will try anything.  Any other ideas out there?
Thanx

Quote
"Craig Farrell" <cNO_SPAM.please.farr...@insprise.com> wrote in message

news:3C964CB4.FBD1B5C9@insprise.com...
Quote
> Hi,

> > How do I import this ActiveX control?

> You could try the IDE switches found in Tools | Environment Options
> | Type Library. Try turning all of the "Ignore special coClass flags"
> switches ON.

> --Craig

Re:BCB6 and ActiveX import problem


Quote
> it is even possible that a control was accidentally marked 'Hide'

To check for a Hidden control go to Tools | Environment Options
| Palette, in the 'Pages' list and select '[All]' (at the bottom)
and scroll through the list of components on the right. If
one is hidden it will show up there with a 'Hidden' label.

--Craig

Re:BCB6 and ActiveX import problem


Hi,

Quote
> Just tried that, but it did not help.  Does BCB typically have problems
> importing ActiveX controls written in VB?  

BCB4 used to ignore CanCreate being false. BCB5 started to recoginize
it and then that became a notorious problem because many VB controls
apparently had that flag set false.

Quote
> little lost...  I will try anything.  Any other ideas out there?

I'd suggest making sure you are getting the latest and greatest
import. If you have been trying many imports of the control,
you might have multiple copies of the import code. What should
happen after you import by default is that the ..\Imports
directory will have a:
 <ControlName>_TLB.h
 <ControlName>_TLB.cpp
 <ControlName>_OCX.h
 <ControlName>_OCX.cpp

Do the times and dates of those files appear to be the latest?
And make sure the package project is really using those
and not some other copy.

If you had started to change options in the import dialog then
the default palette page might change from 'ActiveX' to something
else. Sometimes if controls are not showing up they might actually
be installing into tabs (pages) other than the new intended one and
you need to look at the options in Tools | Environment Options
| Palette to make sure there is not an old tab referenced. Also,
it is even possible that a control was accidentally marked 'Hide'
there if you had been using that Enviornment Options page to
attempt to remove previous failures.

--Craig

Re:BCB6 and ActiveX import problem


Looked for that.  Still not there.  I deleted everything out of ..\Imports
and started over.  Still no go.  I looked for the component in ALL and it is
not there.  This is  a very perplexing problem.
Does anyone know what the command line arguments for tlibimp should look
like?  Maybe that is the way to go....

Thanx

Quote
"Craig Farrell" <cNO_SPAM.please.farr...@insprise.com> wrote in message

news:3C9670FB.301B7E92@insprise.com...
Quote

> > it is even possible that a control was accidentally marked 'Hide'

> To check for a Hidden control go to Tools | Environment Options
> | Palette, in the 'Pages' list and select '[All]' (at the bottom)
> and scroll through the list of components on the right. If
> one is hidden it will show up there with a 'Hidden' label.

> --Craig

Re:BCB6 and ActiveX import problem


In article <3c975e57$1_2@dnews>,
Robert H. Oujesky <rouje...@neuralog.com> wrote:

Quote
>Looked for that.  Still not there.  I deleted everything out of ..\Imports
>and started over.  Still no go.  I looked for the component in ALL and it is
>not there.  This is  a very perplexing problem.
>Does anyone know what the command line arguments for tlibimp should look
>like?  Maybe that is the way to go....

hmmm.

*in the generated header file*, is there a class that derives from
TOleServer or TOleControl which implements the interface you want to
talk to?

If so, check in the register() call in the _OCX.cpp file. It's
possible that the class isn't getting registered for some reason.

If there is no register() procedure, then this means that the
arguments to tlibimp were wrong.

tlibimp -C+ -Ha+ -Hr+ -Hs+ -Ya+

Other Threads