Board index » cppbuilder » Can't import VB 6 ActiveX into C++ Builder 5.0

Can't import VB 6 ActiveX into C++ Builder 5.0

In article <39b76550$1_2@dnews>,

Quote
Wolfgang Giesemann <W.Giesem...@online.de> wrote:

>I have tried to import an ActiveX control that was programmed with Visual Basic 6.0, but neither
>the import via the IDE nor the command line tool TLibImp would generate a wrapper class
>for the control. Is anybody there who can help me solve this problem? I have applied the patch for
>C++Builder 5.0, but that did not help.

get the patched tlibimp and be sure to pass -Yu to the commandline.
Probably the poor OCX thinks it's not creatable.

--
Si vales, valeo.

 

Re:Can't import VB 6 ActiveX into C++ Builder 5.0


Thanks to Robert I'm now a happy user of a beautiful OCX control. But one question still remains: what
is the meaning of the -Yu parameter?

Robert West schrieb:

Quote
> In article <39b76550$1_2@dnews>,
> Wolfgang Giesemann <W.Giesem...@online.de> wrote:

> >I have tried to import an ActiveX control that was programmed with Visual Basic 6.0, but neither
> >the import via the IDE nor the command line tool TLibImp would generate a wrapper class
> >for the control. Is anybody there who can help me solve this problem? I have applied the patch for
> >C++Builder 5.0, but that did not help.

> get the patched tlibimp and be sure to pass -Yu to the commandline.
> Probably the poor OCX thinks it's not creatable.

> --
> Si vales, valeo.

Re:Can't import VB 6 ActiveX into C++ Builder 5.0


In article <39D4A1A4.53342...@online.de>,
Wolfgang Giesemann  <W.Giesem...@online.de> wrote:

Quote
>Thanks to Robert I'm now a happy user of a beautiful OCX control. But one question still remains: what
>is the meaning of the -Yu parameter?

The CoClass structure inside the type library has a bunch of flags that
we use to determine if we can create the object. One of them is
TYPEFLAG_FCANCREATE. For reasons that I don't understand, VB and VC6
under certain circumstances *turn off this flag*; I think it's a bug,
but when I complained to MS, they claimed it was a feature.

The -Yu option tells the code generator to ignore the status of
TYPEFLAG_FCANCREATE. This is, of course, dangerous, if the object
really wasn't creatable (ie., if calling CoCreateInstance() on the thing
would fail), but since the meaning of the flag got changed midstream,
there was little else we could do about it.

The whole thing with type flags -- TYPEFLAG_FRESERVED is another one ---
is a gentleman's agreement: tools like ours agree to ignore objects which
are reserved, hidden, or not creatable in exchange for creators of objects
agreeing to use those flags intelligently. Unfortunately, not everyone
plays nice.

--
Si vales, valeo.

Other Threads