Home > Windows Tips > > Creating ActiveX controls with Delphi
Win IT Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Creating ActiveX controls with Delphi


New Riders
06.21.2000
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Creating ActiveX controls with Delphi

Many hardcore Delphi developers never tire of arguing the merits of VCL components over ActiveX controls. Regardless of your own view, one thing's for sure; you shouldn't allow your preferences to limit your market share. Consider offering your customers both VCL and ActiveX versions.

In his book, Delphi COM Programming (published by MacMillan Technical Publishing), Eric Harmon explains why you should consider converting your VCL to ActiveX, along with clear step-by-step instructions on how to accomplish the conversion.

Creating ActiveX Controls
In this section, I'll show you how to create an ActiveX control from an existing Delphi component. In Delphi, you take an existing visual control (derived from TWinControl) and turn it into an ActiveX control. This means that you can write and test a VCL component completely in Delphi before taking the plunge and creating the ActiveX control.

Reasons to Create ActiveX Controls
With all the capability of the VCL, why should you create an ActiveX control? For one very good reason: You want your control to be usable by all the developers out there who aren't using Delphi. By far, the larg...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


est market for ActiveX controls is the Visual Basic market.

Converting a VCL Component to an ActiveX Control
For purposes of illustration, let's convert the TCheckListBox component into an ActiveXcontrol. To do this, execute the following steps:

  1. From the Delphi main menu, select File, New. The Object Repository is displayed.

  2. On the ActiveX page, select ActiveX Library and click OK.

  3. Select File, New again, and select the ActiveX Control icon from the menu.

  4. ActiveX page of the Object Repository. The ActiveX Control Wizard appears.

  5. From the VCL Class Name combo box, select the VCL component to convert to an ActiveX control.

When you select TCheckListBox in the combo box, the ActiveX Control Wizard automatically generates default values for the ActiveX control name, Implementation unit, Project name, and Threading model.

You should always leave the threading model set to tmApartment, as it is required for ActiveX controls used by Visual Basic.

---------------------------

To learn more, check out the book Delphi COM Programming, published by MacMillan Technical Publishing and available from New Riders

.

Rate this Tip
To rate tips, you must be a member of SearchWinIT.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Windows Technology Updates, Reviews and Solutions

Laptop Discounts with free coupon codes, huge savings at Notebook Review

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts