Board index » cppbuilder » Making an OCX from a non-visual component

Making an OCX from a non-visual component

  I have a component (derived from TComponent) made with BCB 3.0 that do
some serial port communications, so it doesn't  need to be visible at
runtime. How can I make it an OCX?

 thanks in advance,
       Joao Paulo Faria

 

Re:Making an OCX from a non-visual component


You need to declare the misc status flags with the invisible at runtime
setting. I don't have BCB 3 but in BCB 4, there is a macro that you insert
into your ocx class (after you use the wizard: File | New | ActiveX Tab |
ActiveX control). The ocx class is the TYourOCXImpl class that's in
YourOCX.h. In that class, add this macro in a public section:

  DECLARE_OLEMISC_FLAGS(dwDefaultControlMiscFlags |
OLEMISC_INVISIBLEATRUNTIME);

OLEMISC_INVISIBLEATRUNTIME is defined in oleidl.h.

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Joao Paulo Faria <p...@altavista.net> wrote in message
news:7rkkv1$ggc3@forums.borland.com...

Quote
>   I have a component (derived from TComponent) made with BCB 3.0 that do
> some serial port communications, so it doesn't  need to be visible at
> runtime. How can I make it an OCX?

>  thanks in advance,
>        Joao Paulo Faria

Re:Making an OCX from a non-visual component


Or, just make a simple in-place ActiveX automation object. (same as old OLE
automation object)

Rob

Quote
Binh Ly <b...@castle.net> wrote in message

news:7rm021$qt420@forums.borland.com...
: You need to declare the misc status flags with the invisible at runtime
: setting. I don't have BCB 3 but in BCB 4, there is a macro that you insert
: into your ocx class (after you use the wizard: File | New | ActiveX Tab |
: ActiveX control). The ocx class is the TYourOCXImpl class that's in
: YourOCX.h. In that class, add this macro in a public section:
:
:   DECLARE_OLEMISC_FLAGS(dwDefaultControlMiscFlags |
: OLEMISC_INVISIBLEATRUNTIME);
:
: OLEMISC_INVISIBLEATRUNTIME is defined in oleidl.h.
:
: have fun
: --
: Binh Ly
: Visit my COM Notes at http://www.castle.net/~bly/com
:
:
: Joao Paulo Faria <p...@altavista.net> wrote in message
: news:7rkkv1$ggc3@forums.borland.com...
: >   I have a component (derived from TComponent) made with BCB 3.0 that do
: > some serial port communications, so it doesn't  need to be visible at
: > runtime. How can I make it an OCX?
: >
: >  thanks in advance,
: >        Joao Paulo Faria
: >
: >
:
:

Other Threads