Board index » cppbuilder » new ActiveX control error

new ActiveX control error


2006-11-15 07:54:15 PM
cppbuilder80
Hello,
I'm trying to create an activex control deriving from a vcl component,
I used the wizard in BCB6 (File ->New ->ActiveX ->ActiveXControl).
It creates all files but if I try to build the prioject (without
writing any line of code) I get the followings errors:
[C++ Warning] utilcls.h(1153): W8027 Functions containing do are not
expanded inline
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol 'CLSID_BitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol 'IID_IBitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol
'DIID_IBitBtnXEvents'
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol
'LIBID_OF_BitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2401 Invalid template argument list
[C++ Error] BitBtnImpl1.h(13): E2303 Type name expected
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol 'IBitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol 'IID_IBitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol
'LIBID_OF_BitBtnX'
[C++ Error] BitBtnImpl1.h(13): E2401 Invalid template argument list
[C++ Error] BitBtnImpl1.h(13): E2303 Type name expected
[C++ Error] BitBtnImpl1.h(13): E2303 Type name expected
[C++ Error] BitBtnImpl1.h(13): E2275 { expected
[C++ Error] BitBtnImpl1.h(13): E2029 'TBitBtnXImpl' must be a
previously defined class or struct
[C++ Error] BitBtnImpl1.h(13): E2275 { expected
[C++ Warning] BitBtnImpl1.h(29): W8027 Functions containing do are
not expanded inline
[C++ Warning] BitBtnImpl1.h(61): W8027 Functions containing try are
not expanded inline
[C++ Error] BitBtnImpl1.h(29): E2316 'Lock' is not a member of
'TBitBtnXImpl'
[C++ Error] BitBtnImpl1.h(29): E2316 'Unlock' is not a member of
'TBitBtnXImpl'
[C++ Error] BitBtnImpl1.h(29): E2268 Call to undefined function
'InternalQueryInterface'
[C++ Warning] BitBtnImpl1.h(29): W8027 Functions containing static
variables are not expanded inline
[C++ Error] BitBtnImpl1.h(30): E2031 Cannot cast from 'TBitBtnXImpl
*' to 'IViewObjectExImpl<TBitBtnXImpl>*'
[C++ Error] BitBtnImpl1.h(30): E2293 ) expected
[C++ Error] BitBtnImpl1.h(30): E2139 Declaration missing ;
[C++ Warning] BitBtnImpl1.h(44): W8027 Functions containing static
variables are not expanded inline
[C++ Error] BitBtnImpl1.h(44): E2316 'm_sizeExtent' is not a member
of 'TBitBtnXImpl'
[C++ Error] BitBtnImpl1.h(44): E2040 Declaration terminated
incorrectly
[C++ Error] BitBtnImpl1.h(44): E2139 Declaration missing ;
[C++ Warning] BitBtnImpl1.h(54): W8027 Functions containing some if
statements are not expanded inline
[C++ Warning] BitBtnImpl1.h(54): W8027 Functions containing some if
statements are not expanded inline
[C++ Error] BitBtnImpl1.h(61): E2268 Call to undefined function
'GetObjectCLSID'
[C++ Error] BitBtnImpl1.h(61): E2228 Too many error or warning
messages
Any ideas? Thanks in advance.
 
 

Re:new ActiveX control error

<Francesco>wrote in message news: XXXX@XXXXX.COM ...
Quote
[C++ Warning] utilcls.h(1153): W8027 Functions containing do are not
expanded inline
You can ignore that.
Quote
[C++ Error] BitBtnImpl1.h(13): E2451 Undefined symbol 'CLSID_BitBtnX'
Sounds like you did not have the TLB unit's .cpp file in your project.
Gambit
 

Re:new ActiveX control error

Hello Francesco,
Typically the ActiveControl includes a xxxx_TLB.h file that defines the
symbols the compiler is saying are undefined. These symbols are needed for
the component to hook events exposed by the control. Can you confirm whether
a file named xxxx_TLB.h was created? I suspect yes. Can you double check its
content. It's created from the typelibrary created for the ActiveControl. If
the file does not contain the symbols, run TLIBIMP directly on the
typelibrary (*.tlb) file generated and see if you get a better file. If not,
the IDE generated a *bad* typelibrary. The typelibrary is generated by the
IDE from information gathered from the compiler: we basically tell the
compiler to compile the VCL component you want to expose as an ActiveX
control; we use a special entry point in the compiler, called
CompileAndBrowse', and we get called back with the information about the
control. Using that information, we determine which VCL methods, properties
and events are ActiveX-compatible, and we generate a typelibrary.
The other thing to watch for is the IDE's virtual file system. If someone
the IDE already had a file of the name xxxx_TLB.h, that's what it will give
to the compiler even if the wizard creates a new one (by invoking TLIBIMP).
I doubt that's the problem but it happens sometimes.
Let me know if the above helps. If not, I'll probably ask you to zip up the
projects/files generated by the wizard and email them so I can take a look.
Cheers,
Bruneau.
 

{smallsort}

Re:new ActiveX control error

Thank you both for the answer, I've posted the mentioned
project on attachments area as requested with subject "ActiveX for
Bruneau", please have a look. Thanks.
Francesco
Francesco wrote:
Quote

Hello,

I'm trying to create an activex control deriving from a vcl component,
I used the wizard in BCB6 (File ->New ->ActiveX ->ActiveXControl).
It creates all files but if I try to build the prioject (without
writing any line of code) I get the followings errors:

 

Re:new ActiveX control error

Thanks for the upload. I've pulled it down and will post a reply later
today.
Cheers,
Bruneau.
 

Re:new ActiveX control error

Hello Francesco,
The .tlb file generated in this project is empty. Typically this happens if
the 'CompileAndBrowse' callback fails. IOW, the compiler fails to compile
the .hpp file containing the component. Unfortunately, when the compiler
fails, it simply returns silently and there's no hint that none of the
attributes of the VCL component have been converted to ActiveX properties or
methods in the .TLB file.
Is the component you started with the standard TStringGrid of VCL? If yes,
I'll try to find a CBuilder 6 installation and try to reproduce the problem.
Cheers,
Bruneau
 

Re:new ActiveX control error

Hello Jean-Marie,
thank you for the answer, I tried to create activeX from different
vcl controls (TEDit, TButton, TSpeedButton) in {*word*60}ion of that one
that was a standard TStringGrid and the result is the same for all
controls. I reinstalled CBuilder 6 Ent but it didn't solve.
Francesco
Jean-Marie Babet wrote:
Quote
Hello Francesco,

The .tlb file generated in this project is empty. Typically this
happens if the 'CompileAndBrowse' callback fails. IOW, the compiler
fails to compile the .hpp file containing the component.
Unfortunately, when the compiler fails, it simply returns silently
and there's no hint that none of the attributes of the VCL component
have been converted to ActiveX properties or methods in the .TLB file.

Is the component you started with the standard TStringGrid of VCL? If
yes, I'll try to find a CBuilder 6 installation and try to reproduce
the problem.

Cheers,

Bruneau
--
 

Re:new ActiveX control error

For some reason the call to have the compiler give up browser information is
failing.... and sadly, there's no logic in the IDE that detects this as it's
possible to have a control that has no attribute/method that are valid for
COM.
I have not had a chance to try this out yet (I don't have a machine with
BCB6 installed anymore)... I'll relay my findings as soon as possible.
Cheers,
Bruneau.