Components under BCB 3 -- Converting from BCB 1

After struggling with making my .cpp components that used to work under BCB
1 work under BCB 3 and finding very little in the way of help online or in
the manuals, I have pieced together the following recommendations for making
changes to your BCB 1 components to make them work under BCB 3

In the header file, add the keyword PACKAGE to the class declaration,
similar to the following line
 -    class PACKAGE TMyComponent : public TComponent {...}

In the source file, add the keyword PACKAGE to the Register() function:
 -    void __fastcall PACKAGE Register()

In the source file, add the following line after the includes:
 -    #pragma package(smart_init)

Add the following function to make sure that there are no pure virtual

static inline void ValidCtrCheck(TMyComponent *)
     new TMyComponent(NULL);


following is an example Register() statement:

namespace Mycomponent   // DO NOT use "namespace MyComponent" -- the first
letter, and ONLY the first letter must be capitalized
     void __fastcall PACKAGE Register()
          TComponentClass classes[1] = {__classid(TMyComponent
          RegisterComponents("Extras", classes, 0);


The BCB 3 documentation states that you must create your own "package" --
that's what the lines above help to accomplish -- then you include that
package in the component bar.