Board index » cppbuilder » VB Custom ActiveX Control

VB Custom ActiveX Control

I have created several ActiveX Controls using VB6. When I try to import them
to Builder 5 I get no errors,  Builder adds the .cpp files for the OCX's to
"dclusr50.bpk", but they do not show up on the control pallette. I can get
Third party controls  to work but none of my VB controls will.

With VC++ 6.0 I can successfully add the controls to the control tool bar.

Is this a problem with Builder? Does Builder NOT support user controls
created in VB? Is there a work around?

Craig

 

Re:VB Custom ActiveX Control


Make sure that they aren't windowless controls. In VB there is a property
down near the bottom that says Windowless = True/False. VCL does not support
windowless controls.

Chris

Quote
"Craig C." <chisel...@osc2.otis.com> wrote in message

news:3ad49898$1_2@dnews...
Quote
> I have created several ActiveX Controls using VB6. When I try to import
them
> to Builder 5 I get no errors,  Builder adds the .cpp files for the OCX's
to
> "dclusr50.bpk", but they do not show up on the control pallette. I can get
> Third party controls  to work but none of my VB controls will.

> With VC++ 6.0 I can successfully add the controls to the control tool bar.

> Is this a problem with Builder? Does Builder NOT support user controls
> created in VB? Is there a work around?

> Craig

Re:VB Custom ActiveX Control


I got this from another thread, must be a common problem.

BCB 5 has problems to import VB generated OCX (maybe there are a others
too).
Try to use the command line

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

This will create some wrapper files for you. Now copy these files over the
IDE generated files and rebuild your package. In my case (VB OCX) it now
installed to the ActiveX tab.

Quote
"Craig C." <chisel...@osc2.otis.com> wrote in message

news:3ad49898$1_2@dnews...
Quote
> I have created several ActiveX Controls using VB6. When I try to import
them
> to Builder 5 I get no errors,  Builder adds the .cpp files for the OCX's
to
> "dclusr50.bpk", but they do not show up on the control pallette. I can get
> Third party controls  to work but none of my VB controls will.

> With VC++ 6.0 I can successfully add the controls to the control tool bar.

> Is this a problem with Builder? Does Builder NOT support user controls
> created in VB? Is there a work around?

> Craig

Re:VB Custom ActiveX Control


They are NOT windowless.

Craig

Quote
"Chris Bensen" <febr...@hotmail.com> wrote in message

news:3ad4a04b$1_2@dnews...
Quote
> Make sure that they aren't windowless controls. In VB there is a property
> down near the bottom that says Windowless = True/False. VCL does not
support
> windowless controls.

> Chris

> "Craig C." <chisel...@osc2.otis.com> wrote in message
> news:3ad49898$1_2@dnews...
> > I have created several ActiveX Controls using VB6. When I try to import
> them
> > to Builder 5 I get no errors,  Builder adds the .cpp files for the OCX's
> to
> > "dclusr50.bpk", but they do not show up on the control pallette. I can
get
> > Third party controls  to work but none of my VB controls will.

> > With VC++ 6.0 I can successfully add the controls to the control tool
bar.

> > Is this a problem with Builder? Does Builder NOT support user controls
> > created in VB? Is there a work around?

> > Craig

Re:VB Custom ActiveX Control


I could not get this to work either.

I ran the command line as shown below which generated  7 files for the OCX.
I copied these files to a safe directory. I then used the Package editor to
edit dclusr50.bpk. I chose Add, Import ActiveX Control, and selected my
control from the list of registered controls. After the files were created,
I copied the first batch of files that I had saved back to the IMPORTS
directory, overwriting the ones the package editor created. I then compiled
and installed the package but the OCX still does not show up on the User
Control  Pallette.

You say your control is now on the ActiveX Tab? I can only EDIT the user
component package. The ActiveX package cannot be editted.

I am still confused.

Craig C.

Quote
"Steve Waggoner" <steve.dot.waggo...@integtech.dot.com> wrote in message

news:3ae07512$1_1@dnews...
Quote
> I got this from another thread, must be a common problem.

> BCB 5 has problems to import VB generated OCX (maybe there are a others
> too).
> Try to use the command line

> tlibimp -C+ -Yu -Ya -H+ -Q+ -R+ YourActiveX.ocx

> This will create some wrapper files for you. Now copy these files over the
> IDE generated files and rebuild your package. In my case (VB OCX) it now
> installed to the ActiveX tab.

> "Craig C." <chisel...@osc2.otis.com> wrote in message
> news:3ad49898$1_2@dnews...
> > I have created several ActiveX Controls using VB6. When I try to import
> them
> > to Builder 5 I get no errors,  Builder adds the .cpp files for the OCX's
> to
> > "dclusr50.bpk", but they do not show up on the control pallette. I can
get
> > Third party controls  to work but none of my VB controls will.

> > With VC++ 6.0 I can successfully add the controls to the control tool
bar.

> > Is this a problem with Builder? Does Builder NOT support user controls
> > created in VB? Is there a work around?

> > Craig

Re:VB Custom ActiveX Control


Quote

> You say your control is now on the ActiveX Tab? I can only EDIT the user
> component package. The ActiveX package cannot be editted.

I haven't tried using packages and putting the vb component in the palette
but it
should work. I hope there are not more issues in an already troubling
feature :-)

The problem I was having with using VB-OCXs was that when there were
imported it created the 5 files Ok. But when you look at the files closely
they did not contain the visual basic wrapper classes, properties, etc.

That command line for TLIBIMP worked in fixing that problem.

I tested it by creating simple application that included the generate files
and I dynamically created the vb control on my form with something like
this in a button handler.

        TVbComponent* ctl = new TVbComponent(this);
        ctl->Parent = this;

Other Threads