Tuesday, August 24, 2004

VCL Component registration.

How many of you have found that when you create a design-time package for Delphi, there are many things you can do in the unit initialization equally as well as using the “sanctioned” technique of providing a single global procedure called “Register”?  You may have discovered that things like the Open Tools API services are available, you can register property/component editors with some success as well.  Well... stop it!  Please make sure you are using the properly sanctioned technique of placing all this code into a “Register” procedure in one or more units in the design-time package. 

There are some new features and services that the next version of Delphi that heavily relies on the registration of wizard, components, property/component editors, and custom modules be done from within a Register procedure.  Let's just say that the next version of Delphi will “demand” that component developers are following the rules.  The good thing about this is that using the Register procedure will work for all versions of Delphi, so you shouldn't be breaking any backward compatibility, nor are you going to be required to introduce yet another IFDEF.  If you take a quick look over your code and make sure that this is the case, then you should be in very good shape and ready when we release the next version of Delphi.