Главная страница | назад





Article #17098: My ActiveX control won't work in as a Component!!!

 Question and Answer Database

FAQ2098C.txt   My ActiveX control won't work in as a Component!!!
Category   :IDE
Platform    :All
Product    :C++Builder  3.x

Question:
I create an ActiveX control derived from _______ Component.  I 
don't touch the code just compile and register it.  This all
works fine.  I then install the control into the Component 
Pallete.  I then start a new project, lay down the control 
and compile the project.  This all works fine, but when I run
the project, an exception is thrown and the project doesn't 
work.  What is wrong? 

Answer:
What is wrong is that when you make a ActiveX control and 
register it, it creates a ..._TLB.cpp and ..._TLB.h that is put 
in the /lib and /include directories under C++Builder3.  Your 
project is in the same directory that the ActiveX control was 
made in, and therefore is using this ..._TLB.h and ..._TLB.cpp 
that is in the project directory, and is not using the correct
one.

Do not have your new project that uses the ocx in the same
directoru as the ocx.

Things will be fine if you follow this rule.


7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99