Board index » cppbuilder » BCB 5 and VB ActiveX Controls

BCB 5 and VB ActiveX Controls

I have attempted to import 2 different Visual Basic 6.0 ActiveX controls
into BCB 5.  The controls seem to import successfully but they never get
placed on the tools palette.  I leave all settings to the default for the
import (the ActiveX panel is where they are supposed to get installed).

The project I am working on is on delay because of this.  Originally, it was
on delay because BCB 4 did not support VB sparse vtables.  We ordered BCB5.
BCB5 says it supports sparse vtables but it won't put the control on the
palette.  Yeesh.

Anyone with a work-around or information about this particular problem,
please respond.

Thank you!
Harold L. Blankenship
hbl...@pxlmagic.com

 

Re:BCB 5 and VB ActiveX Controls


In article <89oor3$q...@bornews.borland.com>,

Quote
Harold <hbl...@pxlmagic.com> wrote:
>I have attempted to import 2 different Visual Basic 6.0 ActiveX controls
>into BCB 5.  The controls seem to import successfully but they never get
>placed on the tools palette.  I leave all settings to the default for the
>import (the ActiveX panel is where they are supposed to get installed).

>The project I am working on is on delay because of this.  Originally, it was
>on delay because BCB 4 did not support VB sparse vtables.  We ordered BCB5.
>BCB5 says it supports sparse vtables but it won't put the control on the
>palette.  Yeesh.

VB6 controls have type libraries which, for reasons inexplicable to me,
do not have the 'CAN_CREATE' flag set --- so the importer, which believes
that controls that don't have CAN_CREATE set aren't creatable, ignores them.

I have contacted MS to complain about this and they claim (a) that it
is correct that they are marked uncreatable because they must be contained
(which is a definition change from what the spec says the flag means),
and (b) that there is no way to differentiate between a control which
is uncreatable in this meaning and a control which is uncreatable in the
old meaning.

TLIBIMP.EXE (the command line version of the importer) has an undocumented
switch -Yu which will ignore the CAN_CREATE flag and generate wrappers
anyway. If you import the controls using tlibimp:

tlibimp -C+ -Yu -H+ -Q+ -R+ foo.ocx

and then add the files into your package, the package will contain
control wrappers, and they will appear on the palette.

--
Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


Alas, this did not solve the problem and gave me the same results as using
the IDE import ActiveX control did.  Essentially, it makes all the files but
the *_ocx.cpp file, which should contain the methods/etc of the ocx instead
contains only an empty namespace block and that is all.

Thank you.
Harold Blankenship

Quote
<aphr...@magescave.blackforest.org> wrote in message

news:89p1ot$hf7$1@breaker.inprise.com...
Quote
> In article <89oor3$q...@bornews.borland.com>,
> Harold <hbl...@pxlmagic.com> wrote:
> >I have attempted to import 2 different Visual Basic 6.0 ActiveX controls
> >into BCB 5.  The controls seem to import successfully but they never get
> >placed on the tools palette.  I leave all settings to the default for the
> >import (the ActiveX panel is where they are supposed to get installed).

> >The project I am working on is on delay because of this.  Originally, it
was
> >on delay because BCB 4 did not support VB sparse vtables.  We ordered
BCB5.
> >BCB5 says it supports sparse vtables but it won't put the control on the
> >palette.  Yeesh.

> VB6 controls have type libraries which, for reasons inexplicable to me,
> do not have the 'CAN_CREATE' flag set --- so the importer, which believes
> that controls that don't have CAN_CREATE set aren't creatable, ignores
them.

> I have contacted MS to complain about this and they claim (a) that it
> is correct that they are marked uncreatable because they must be contained
> (which is a definition change from what the spec says the flag means),
> and (b) that there is no way to differentiate between a control which
> is uncreatable in this meaning and a control which is uncreatable in the
> old meaning.

> TLIBIMP.EXE (the command line version of the importer) has an undocumented
> switch -Yu which will ignore the CAN_CREATE flag and generate wrappers
> anyway. If you import the controls using tlibimp:

> tlibimp -C+ -Yu -H+ -Q+ -R+ foo.ocx

> and then add the files into your package, the package will contain
> control wrappers, and they will appear on the palette.

> --
> Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


In article <89p5d4$q...@bornews.borland.com>,

Quote
Harold <hbl...@pxlmagic.com> wrote:
>Alas, this did not solve the problem and gave me the same results as using
>the IDE import ActiveX control did.  Essentially, it makes all the files but
>the *_ocx.cpp file, which should contain the methods/etc of the ocx instead
>contains only an empty namespace block and that is all.

Open the OCX in the type library editor
(File|Open, with the .tlb mask set),

and check the following flags on the coclass:
  *CAN_CREATE
  *HIDDEN
  *RESTRICTED
  *CONTROL

if either hidden or restricted are set, you also need to pass the
option to override those. If control is not set, then it is not
possible to wrap the control.

Quote
>Thank you.
>Harold Blankenship

><aphr...@magescave.blackforest.org> wrote in message
>news:89p1ot$hf7$1@breaker.inprise.com...
>> In article <89oor3$q...@bornews.borland.com>,
>> Harold <hbl...@pxlmagic.com> wrote:
>> >I have attempted to import 2 different Visual Basic 6.0 ActiveX controls
>> >into BCB 5.  The controls seem to import successfully but they never get
>> >placed on the tools palette.  I leave all settings to the default for the
>> >import (the ActiveX panel is where they are supposed to get installed).

>> >The project I am working on is on delay because of this.  Originally, it
>was
>> >on delay because BCB 4 did not support VB sparse vtables.  We ordered
>BCB5.
>> >BCB5 says it supports sparse vtables but it won't put the control on the
>> >palette.  Yeesh.

>> VB6 controls have type libraries which, for reasons inexplicable to me,
>> do not have the 'CAN_CREATE' flag set --- so the importer, which believes
>> that controls that don't have CAN_CREATE set aren't creatable, ignores
>them.

>> I have contacted MS to complain about this and they claim (a) that it
>> is correct that they are marked uncreatable because they must be contained
>> (which is a definition change from what the spec says the flag means),
>> and (b) that there is no way to differentiate between a control which
>> is uncreatable in this meaning and a control which is uncreatable in the
>> old meaning.

>> TLIBIMP.EXE (the command line version of the importer) has an undocumented
>> switch -Yu which will ignore the CAN_CREATE flag and generate wrappers
>> anyway. If you import the controls using tlibimp:

>> tlibimp -C+ -Yu -H+ -Q+ -R+ foo.ocx

>> and then add the files into your package, the package will contain
>> control wrappers, and they will appear on the palette.

>> --
>> Si vales, valeo.

--
Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


Still no joy.
The coclass indicates Control.  I have used all options for overriding the
hidden/restricted/etc attributes (in fact, it was the first thing I tried
after the initial tlibimp idea failed).

I begin to wonder if there is some Visual Basic option or other that HAS to
be set for the VB ActiveX control to be used in Borland.  I am assuming by
your answers that you experienced the problem initially but then resolved
the problem by the methods you have proposed herein.  That would indicate
that there is some other influence on the process than just BCB.

I continue to persevere in my search for a solution.  If found, I will post
it here.  Perhaps TeamB may some day interject a modicum of insight on the
matter.

Thank you for the suggestions!
Perplexed,
Harold Blankenship

Quote
<aphr...@magescave.blackforest.org> wrote in message

news:89pejl$htr$1@breaker.inprise.com...
Quote
> In article <89p5d4$q...@bornews.borland.com>,
> Harold <hbl...@pxlmagic.com> wrote:
> >Alas, this did not solve the problem and gave me the same results as
using
> >the IDE import ActiveX control did.  Essentially, it makes all the files
but
> >the *_ocx.cpp file, which should contain the methods/etc of the ocx
instead
> >contains only an empty namespace block and that is all.

> Open the OCX in the type library editor
> (File|Open, with the .tlb mask set),

> and check the following flags on the coclass:
>   *CAN_CREATE
>   *HIDDEN
>   *RESTRICTED
>   *CONTROL

> if either hidden or restricted are set, you also need to pass the
> option to override those. If control is not set, then it is not
> possible to wrap the control.

Re:BCB 5 and VB ActiveX Controls


In article <89peqo$q...@bornews.borland.com>,

Quote
Harold <hbl...@pxlmagic.com> wrote:
>Still no joy.
>The coclass indicates Control.  I have used all options for overriding the
>hidden/restricted/etc attributes (in fact, it was the first thing I tried
>after the initial tlibimp idea failed).

Remember to combine those with -Yu.

OK, here's another thought. In _OCX.H, check and see if there is
anything derived from either TOleControl or TOleServer. It may be
that the components are being created, but the Register function
isn't being generated for some reason.

Quote
>I begin to wonder if there is some Visual Basic option or other that HAS to
>be set for the VB ActiveX control to be used in Borland.  I am assuming by

Not that i've been told --- although, if the control expects to be
windowless activated, we can't host it. But the behavior you are getting
is not indicative of that being the problem; control wrappers would
be generated for such controls, and then would fail at runtime. If you aren't
getting controls at all, something else is going on.

If you would like, upload the .ocx to .binaries, and then send me mail
indicating you have done so, and what the subject is.

Robert West
rw...@inprise.com
C++Builder R&D
--
Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


Quote
Harold wrote:

[snip]
Quote
> I continue to persevere in my search for a solution.  If found, I will post
> it here.  Perhaps TeamB may some day interject a modicum of insight on the
> matter.

Well, you've been getting it from the TLE developer ;)

alex

Re:BCB 5 and VB ActiveX Controls


Perhaps Borland should add some flexibility to their Import ActiveX wizard that
allows the user to tweak the import settings from the IDE. This would make it
easier to get around those ActiveX controls which don't quite follow the accepted
standards regarding flags, without having to invoke a command line syntax.
Quote
aphr...@magescave.blackforest.org wrote:
> In article <89oor3$q...@bornews.borland.com>,
> Harold <hbl...@pxlmagic.com> wrote:
> >I have attempted to import 2 different Visual Basic 6.0 ActiveX controls
> >into BCB 5.  The controls seem to import successfully but they never get
> >placed on the tools palette.  I leave all settings to the default for the
> >import (the ActiveX panel is where they are supposed to get installed).

> >The project I am working on is on delay because of this.  Originally, it was
> >on delay because BCB 4 did not support VB sparse vtables.  We ordered BCB5.
> >BCB5 says it supports sparse vtables but it won't put the control on the
> >palette.  Yeesh.

> VB6 controls have type libraries which, for reasons inexplicable to me,
> do not have the 'CAN_CREATE' flag set --- so the importer, which believes
> that controls that don't have CAN_CREATE set aren't creatable, ignores them.

> I have contacted MS to complain about this and they claim (a) that it
> is correct that they are marked uncreatable because they must be contained
> (which is a definition change from what the spec says the flag means),
> and (b) that there is no way to differentiate between a control which
> is uncreatable in this meaning and a control which is uncreatable in the
> old meaning.

> TLIBIMP.EXE (the command line version of the importer) has an undocumented
> switch -Yu which will ignore the CAN_CREATE flag and generate wrappers
> anyway. If you import the controls using tlibimp:

> tlibimp -C+ -Yu -H+ -Q+ -R+ foo.ocx

Re:BCB 5 and VB ActiveX Controls


How about this:

tlibimp -C+ -Yu -H+ -Q+ -R+ foo.tlb

foo.tlb being the modified type library that has the CAN_CREATE flag.

Chris

Quote
<aphr...@magescave.blackforest.org> wrote in message

news:89pgfv$i29$1@breaker.inprise.com...
Quote
> In article <89peqo$q...@bornews.borland.com>,
> Harold <hbl...@pxlmagic.com> wrote:
> >Still no joy.
> >The coclass indicates Control.  I have used all options for overriding
the
> >hidden/restricted/etc attributes (in fact, it was the first thing I tried
> >after the initial tlibimp idea failed).

> Remember to combine those with -Yu.

> OK, here's another thought. In _OCX.H, check and see if there is
> anything derived from either TOleControl or TOleServer. It may be
> that the components are being created, but the Register function
> isn't being generated for some reason.

> >I begin to wonder if there is some Visual Basic option or other that HAS
to
> >be set for the VB ActiveX control to be used in Borland.  I am assuming
by

> Not that i've been told --- although, if the control expects to be
> windowless activated, we can't host it. But the behavior you are getting
> is not indicative of that being the problem; control wrappers would
> be generated for such controls, and then would fail at runtime. If you
aren't
> getting controls at all, something else is going on.

> If you would like, upload the .ocx to .binaries, and then send me mail
> indicating you have done so, and what the subject is.

> Robert West
> rw...@inprise.com
> C++Builder R&D
> --
> Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


In article <38C10CE5.C9DD3...@abraxis.com>,
Edward Diener  <eddie...@abraxis.com> wrote:

Quote
>Perhaps Borland should add some flexibility to their Import ActiveX wizard that
>allows the user to tweak the import settings from the IDE. This would make it
>easier to get around those ActiveX controls which don't quite follow the accepted
>standards regarding flags, without having to invoke a command line syntax.

Oh, I absolutely agree. I wanted to do this for BCB5, but other things
took priority over it ...

--
Si vales, valeo.

Re:BCB 5 and VB ActiveX Controls


The undocumented hack appears to not work in all cases -- only in ones
where the control is marked APPOBJECT. (This makes sense --- when I added
the hack workaround, I was trying to be _extremely_ restrictive, as I
was strongly of the opinion that things that are not 'creatable' are,
simply put, not creatable. The APPOBJECT override was needed because
of the inherent contradiction in having an APPOBJECT which isn't creatable,
but I didn't want to overextend the ability ... Maybe that needs to be
revisited.)

I opened up the .ocx, changed the CAN_CREATE flag, and saved it to a .tlb,
and then imported that, and it worked.

Quote
Harold wrote:

> Still no joy.
> The coclass indicates Control.  I have used all options for overriding the
> hidden/restricted/etc attributes (in fact, it was the first thing I tried
> after the initial tlibimp idea failed).

> I begin to wonder if there is some Visual Basic option or other that HAS to
> be set for the VB ActiveX control to be used in Borland.  I am assuming by
> your answers that you experienced the problem initially but then resolved
> the problem by the methods you have proposed herein.  That would indicate
> that there is some other influence on the process than just BCB.

> I continue to persevere in my search for a solution.  If found, I will post
> it here.  Perhaps TeamB may some day interject a modicum of insight on the
> matter.

> Thank you for the suggestions!
> Perplexed,
> Harold Blankenship

> <aphr...@magescave.blackforest.org> wrote in message
> news:89pejl$htr$1@breaker.inprise.com...
> > In article <89p5d4$q...@bornews.borland.com>,
> > Harold <hbl...@pxlmagic.com> wrote:
> > >Alas, this did not solve the problem and gave me the same results as
> using
> > >the IDE import ActiveX control did.  Essentially, it makes all the files
> but
> > >the *_ocx.cpp file, which should contain the methods/etc of the ocx
> instead
> > >contains only an empty namespace block and that is all.

> > Open the OCX in the type library editor
> > (File|Open, with the .tlb mask set),

> > and check the following flags on the coclass:
> >   *CAN_CREATE
> >   *HIDDEN
> >   *RESTRICTED
> >   *CONTROL

> > if either hidden or restricted are set, you also need to pass the
> > option to override those. If control is not set, then it is not
> > possible to wrap the control.

Re:BCB 5 and VB ActiveX Controls


Can some one please summerise what was the result of this thread.. I have read it
but
its not clear as to the outcome...

Thanks in advance...

TW

Quote
aphrael wrote:
> The undocumented hack appears to not work in all cases -- only in ones
> where the control is marked APPOBJECT. (This makes sense --- when I added
> the hack workaround, I was trying to be _extremely_ restrictive, as I
> was strongly of the opinion that things that are not 'creatable' are,
> simply put, not creatable. The APPOBJECT override was needed because
> of the inherent contradiction in having an APPOBJECT which isn't creatable,
> but I didn't want to overextend the ability ... Maybe that needs to be
> revisited.)

> I opened up the .ocx, changed the CAN_CREATE flag, and saved it to a .tlb,
> and then imported that, and it worked.

> Harold wrote:

> > Still no joy.
> > The coclass indicates Control.  I have used all options for overriding the
> > hidden/restricted/etc attributes (in fact, it was the first thing I tried
> > after the initial tlibimp idea failed).

> > I begin to wonder if there is some Visual Basic option or other that HAS to
> > be set for the VB ActiveX control to be used in Borland.  I am assuming by
> > your answers that you experienced the problem initially but then resolved
> > the problem by the methods you have proposed herein.  That would indicate
> > that there is some other influence on the process than just BCB.

> > I continue to persevere in my search for a solution.  If found, I will post
> > it here.  Perhaps TeamB may some day interject a modicum of insight on the
> > matter.

> > Thank you for the suggestions!
> > Perplexed,
> > Harold Blankenship

> > <aphr...@magescave.blackforest.org> wrote in message
> > news:89pejl$htr$1@breaker.inprise.com...
> > > In article <89p5d4$q...@bornews.borland.com>,
> > > Harold <hbl...@pxlmagic.com> wrote:
> > > >Alas, this did not solve the problem and gave me the same results as
> > using
> > > >the IDE import ActiveX control did.  Essentially, it makes all the files
> > but
> > > >the *_ocx.cpp file, which should contain the methods/etc of the ocx
> > instead
> > > >contains only an empty namespace block and that is all.

> > > Open the OCX in the type library editor
> > > (File|Open, with the .tlb mask set),

> > > and check the following flags on the coclass:
> > >   *CAN_CREATE
> > >   *HIDDEN
> > >   *RESTRICTED
> > >   *CONTROL

> > > if either hidden or restricted are set, you also need to pass the
> > > option to override those. If control is not set, then it is not
> > > possible to wrap the control.

Other Threads