RAD Studio
ContentsIndex
PreviousUpNext
Specifying the Components

Within the Register procedure, pass the component names in an open array, which you can construct inside the call to RegisterComponents.

RegisterComponents('Miscellaneous', [TMyComponent]);

 

TMetaClass classes[1] = {__classid(TNewComponent)};

You could also register several components on the same page at once, or register components on different pages, as shown in the following code:

procedure Register;
begin
  RegisterComponents('Miscellaneous', [TFirst, TSecond]);            { two on this page... }
  RegisterComponents('Assorted', [TThird]);                         { ...one on another... }
  RegisterComponents(LoadStr(srStandard), [TFourth]);    { ...and one on the Standard page }
end;

 

TMetaClass classes[2] =
{__classid(TNewComponent), __classid(TAnotherComponent)};

 

//Another way to add a component to the array
TMetaClass classes[2];
classes[0] = __classid(TNewComponent);
classes[1] = __classid(TAnotherComponent);
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!