BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Registering components

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Kevin
Guest





PostPosted: Mon Aug 25, 2003 5:44 pm    Post subject: Registering components Reply with quote



I am trying to register a component under Delphi 4. The proc looks like
this:

procedure Register;
begin
RegisterComponents(LoadStr(srAdditional), [TKTrackBar]);
end;

The compiler rejects srAdditional as undeclared. Is there a unit I should
USE?

Also, how do I uninstall a version of this component that I put on its own
page (it was installed individually, not as part of a package)?



Back to top
Rob Kennedy
Guest





PostPosted: Mon Aug 25, 2003 6:36 pm    Post subject: Re: Registering components Reply with quote



Kevin wrote:
Quote:
I am trying to register a component under Delphi 4. The proc looks like
this:

procedure Register;
begin
RegisterComponents(LoadStr(srAdditional), [TKTrackBar]);
end;

The compiler rejects srAdditional as undeclared. Is there a unit I should
USE?

That symbol doesn't appear anywhere in the D5 source directory. If you
got that line from an example, go take a closer look at what the example
was using.

Quote:
Also, how do I uninstall a version of this component that I put on its own
page (it was installed individually, not as part of a package)?

I wasn't aware it was possible to install a component that way.
Right-click the component palette and choose properties. Find the
component in the list shown, and it should include the name of the
package in which it resides. Uninstall that package or edit the package
to remove that component.

--
Rob


Back to top
Kevin
Guest





PostPosted: Mon Aug 25, 2003 7:16 pm    Post subject: Re: Registering components Reply with quote



The help says to use Loadstr to get the page identifier and gives srStandard
as an example. Excerpt from help pasted below:

If you want to install a component on one of the standard pages, you
should
obtain the string for the page name by calling the LoadStr function,
passing the
constant representing the string resource for that page, such as srSystem
for the
System page.

Another part of the help shows this example:

RegisterComponents(LoadStr(srStandard), [TFourth]);

Since the helps tells me to do it this way that's how I tried it. I tried
'Additional' as well with no change in the way things are registered.

I registered the component without building a package for it. That means it
got put into DCLUSR40. I have tried screwing around with the DPK for that
but it never gets taken out of the BPL file and I don't know enough to mess
with it further. Uninstalling DCLUSR40 changes everything and I have to put
it back to make my other stuff work..
-K

"Rob Kennedy" <.> wrote

Quote:
Kevin wrote:
I am trying to register a component under Delphi 4. The proc looks like
this:

procedure Register;
begin
RegisterComponents(LoadStr(srAdditional), [TKTrackBar]);
end;

The compiler rejects srAdditional as undeclared. Is there a unit I
should
USE?

That symbol doesn't appear anywhere in the D5 source directory. If you
got that line from an example, go take a closer look at what the example
was using.

Also, how do I uninstall a version of this component that I put on its
own
page (it was installed individually, not as part of a package)?

I wasn't aware it was possible to install a component that way.
Right-click the component palette and choose properties. Find the
component in the list shown, and it should include the name of the
package in which it resides. Uninstall that package or edit the package
to remove that component.

--
Rob




Back to top
Graham Harris
Guest





PostPosted: Mon Aug 25, 2003 8:49 pm    Post subject: Re: Registering components Reply with quote

I tend to use the following:

RegisterComponents('D4U', [TTrayNotifyIcon]);

i.e. RegisterComponents(const Page: string; ComponentClasses: array of
TComponentClass)

In D6's or D4's help what you have stated does not exist.

Graham Harris


"Kevin" <kevin (AT) sovereignsystems (DOT) com> wrote

Quote:
The help says to use Loadstr to get the page identifier and gives
srStandard
as an example. Excerpt from help pasted below:

If you want to install a component on one of the standard pages, you
should
obtain the string for the page name by calling the LoadStr function,
passing the
constant representing the string resource for that page, such as
srSystem
for the
System page.

Another part of the help shows this example:

RegisterComponents(LoadStr(srStandard), [TFourth]);

Since the helps tells me to do it this way that's how I tried it. I tried
'Additional' as well with no change in the way things are registered.

I registered the component without building a package for it. That means
it
got put into DCLUSR40. I have tried screwing around with the DPK for that
but it never gets taken out of the BPL file and I don't know enough to
mess
with it further. Uninstalling DCLUSR40 changes everything and I have to
put
it back to make my other stuff work..
-K

"Rob Kennedy" <.> wrote

Kevin wrote:
I am trying to register a component under Delphi 4. The proc looks
like
this:

procedure Register;
begin
RegisterComponents(LoadStr(srAdditional), [TKTrackBar]);
end;

The compiler rejects srAdditional as undeclared. Is there a unit I
should
USE?

That symbol doesn't appear anywhere in the D5 source directory. If you
got that line from an example, go take a closer look at what the example
was using.

Also, how do I uninstall a version of this component that I put on its
own
page (it was installed individually, not as part of a package)?

I wasn't aware it was possible to install a component that way.
Right-click the component palette and choose properties. Find the
component in the list shown, and it should include the name of the
package in which it resides. Uninstall that package or edit the package
to remove that component.

--
Rob







Back to top
Kevin
Guest





PostPosted: Mon Aug 25, 2003 9:44 pm    Post subject: Re: Registering components Reply with quote

Quote:
In D6's or D4's help what you have stated does not exist.

Graham Harris


It is in D4's help in the topic "Making components available at design time"
under "Specifying the palette page." I found it using the 'Find' tab and
"srs" but you can get to it through thte index, too.
To use the index:
1) Go to "Component Writing" and click the "Making available" subitem.
This brings up a dialog.
2) Select "Making components available at design time: Overview"
3) Click "Topic Group"
4) In the Topic Group side window click "Specifying the palette page."

Quote:
RegisterComponents('D4U', [TTrayNotifyIcon]);

This would work the first time but if I later switched to

RegisterComponents('NotD4U', [TTrayNotifyIcon]);

it would still only appear under D4U. I would also not know how to remove
it from the D4U page.






Back to top
Rob Kennedy
Guest





PostPosted: Mon Aug 25, 2003 9:52 pm    Post subject: Re: Registering components Reply with quote

Graham Harris wrote:
Quote:
"Kevin" <kevin (AT) sovereignsystems (DOT) com> wrote in message
news:3f4a60ac$1 (AT) newsgroups (DOT) borland.com...
The help says to use Loadstr to get the page identifier and gives
srStandard as an example. Excerpt from help pasted below:

If you want to install a component on one of the standard pages,
you should obtain the string for the page name by calling the
LoadStr function, passing the constant representing the string
resource for that page, such as srSystem for the System page.

In D6's or D4's help what you have stated does not exist.

Kevin said he's using D4, and I'm pretty sure he didn't just make up the
text he posted. It's in D5's help file, too. I got found it this way:

1. Open the Creating Custom Components help file.

2. Select "procedure, Register" from the index.

3. Select "Specifying the palette page" from that topic.

The strings "srStandard" and "srAdditional" appear in the DclStd
package. Simply adding that to the package's Requires list could do the
trick.

Quote:
I registered the component without building a package for it. That
means it got put into DCLUSR40. I have tried screwing around with
the DPK for that but it never gets taken out of the BPL file and I
don't know enough to mess with it further.

You did recompile the DPK after changing it, didn't you?

--
Rob



Back to top
Kevin
Guest





PostPosted: Tue Aug 26, 2003 12:29 am    Post subject: Re: Registering components Reply with quote

Yeah, I recompiled it but it made no difference.

"Rob Kennedy" <.> wrote

Quote:
Graham Harris wrote:
"Kevin" <kevin (AT) sovereignsystems (DOT) com> wrote in message
news:3f4a60ac$1 (AT) newsgroups (DOT) borland.com...
The help says to use Loadstr to get the page identifier and gives
srStandard as an example. Excerpt from help pasted below:

If you want to install a component on one of the standard pages,
you should obtain the string for the page name by calling the
LoadStr function, passing the constant representing the string
resource for that page, such as srSystem for the System page.

In D6's or D4's help what you have stated does not exist.

Kevin said he's using D4, and I'm pretty sure he didn't just make up the
text he posted. It's in D5's help file, too. I got found it this way:

1. Open the Creating Custom Components help file.

2. Select "procedure, Register" from the index.

3. Select "Specifying the palette page" from that topic.

The strings "srStandard" and "srAdditional" appear in the DclStd
package. Simply adding that to the package's Requires list could do the
trick.

I registered the component without building a package for it. That
means it got put into DCLUSR40. I have tried screwing around with
the DPK for that but it never gets taken out of the BPL file and I
don't know enough to mess with it further.

You did recompile the DPK after changing it, didn't you?

--
Rob





Back to top
Marc Rohloff
Guest





PostPosted: Tue Aug 26, 2003 12:17 pm    Post subject: Re: Registering components Reply with quote

At least in D7 you need to use the unit 'dsnconst' which as Rob said is
in the package 'dclstd'

Marc

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.