3
votes

I've written a series of ActiveX controls in Delphi to be used in other development environments (like Visual Studio or dBASE for Windows, as two examples)

I used the ActiveX wizards provided as part of the RAD Studio IDE to generate the ActiveX "bindings" (for want of a better word) for my VCL-based controls, however it appears not to produce the source necessary to make them appear on IDE component pallets.

Ordinarily on those IDEs (Visual Studio and dBASE Plus), I can simply import an ActiveX control and it will show up on their toolbox (their version of a component pallet) complete with their defined icon.

Well, my own ActiveX controls produced in Delphi do not (they import just fine, but don't show up on the pallet/toolbox), and I've been scouring Google trying to find a solution for the last two weeks.

Having failed miserably, I've decided to ask here:

How do I make my ActiveX controls show up on the Toolbox in Visual Studio (and others)?

Thanks for any advice/suggestions.

EDIT: Some extra info...

I've been trying to do this with both XE2 and XE3, and it has failed every time... however, when I do the same thing (using the Wizards) with Delphi 2007, the component's icon does show up in the Pallet/Toolbox of other IDEs as desired. This means the issue was introduced sometime after Delphi 2007, and is likely the result of some RTL/VCL modification.

1
It sounds like you need to take this up with Embarcadero.500 - Internal Server Error
I just created a simple test with a BitButton. The import works. The control appears in the General section of the Toolbox next to the Pointer. When I drag the control on a form in VS2012 (Oxygene not a full VS) the Studio tells me - Failed to import the ActiveX control. Please ensure it is properly registered. But I found no OCX control that worked. So I don't know if the test is a good one.user1188260
@MichaelBunny: You need to register the ActiveX Server (Delphi's Run->Register ActiveX Server, or use regsvr32 YourControl.DLL from the project's folder at a command prompt) before you can actually use it.Ken White
The OCX file is indeeded registered, and can be used via the ActiveX container object... I just need it to show up in the ActiveX pallet on dBASE Plus (that's the intended userbase for this thing). As I say: produce one with D2007 and it all works perfectly, D2009 or above and it doesn't. I'm thinking a unicode issue.LaKraven

1 Answers

1
votes

My research has concluded that Unicode versions of Delphi (2009 to XE3) do not generate the correct markup for ActiveX Controls using the provided wizards.

Further-more, changes to the RTL and VCL since Delphi 2007 mean that, even if you produce the necessary source markup manually, your controls will not behave properly when embedded in non-Delphi applications (such as Visual Studio and dBASE Plus). Much of this relates to the VCL's presumption of a VCL-compliant Parent property value, where the update of properties such as ParentFont will result in an Access Violation error.

The solution in my case has been to produce the exported ActiveX Controls in Delphi 2007 (with it being the latest version to "play fair" with other ActiveX Control consumers)

Hopefully this information will save you the long and annoying fact-finding process I had to go through in order to come to this conclusion.