Mega Code Archive

 
Categories / Delphi / Examples
 

Imported activex control not appearing in the component palette

Question: I'm trying to import an ActiveX component. To do this, I use Component|Import ActiveX Control... select the control from the list (i've already installed and registered the component), compile and install the package. The weird thing is that the XXX_TLB.as file doesn't have any class defining the component, just interfaces. When I install it, it doesn't add any item in the component palette. Is it possible for this ActiveX control to be runtime only and not for development or something like that? Answer: That can happen when the control is declared as non-creatable in the type library - VB does that. In D6+: Set the Tools | Environment Options | Type library | Ignore CanCreate flags when importing option to true before importing the control. In previous Delphi versions: Use File|Open, set the filter to Type Library files, open the OCX, and have a look at the CanCreate flag in the type library editor. Set it to true, save the type library as a tlb, and try importing that.