About choosing the identifier number for a resource entry

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

About choosing the identifier number for a resource entry

Yan Wu-6
Hi,

I created a new hrc & src in svx/source/tbxctrls to define a resource
entry for the string 'Find' of Find Toolbar(some other strings will also
be defined later). The new hrc is defined as:
#define RID_SVXSTR_FINDBAR_FIND 1

, and the src is defined as:
String RID_SVXSTR_FINDBAR_FIND
{
    Text [ en-US ] = "Find" ;
};
There would be a compiling warning "Global resources should have an
identifier >= 256", so I changed 1 to 256. Will this number(256) be
conflicted with other identifier number? How to choose the identifier
number when defining a resource entry?

Regards,
Yan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: About choosing the identifier number for a resource entry

Carsten Driesner-3
Yan Wu wrote:

> Hi,
>
> I created a new hrc & src in svx/source/tbxctrls to define a resource
> entry for the string 'Find' of Find Toolbar(some other strings will also
> be defined later). The new hrc is defined as:
> #define RID_SVXSTR_FINDBAR_FIND 1
>
> , and the src is defined as:
> String RID_SVXSTR_FINDBAR_FIND
> {
>    Text [ en-US ] = "Find" ;
> };
> There would be a compiling warning "Global resources should have an
> identifier >= 256", so I changed 1 to 256. Will this number(256) be
> conflicted with other identifier number? How to choose the identifier
> number when defining a resource entry?
Hi Yan,

Please don't use a separate header file for your string resources. There
is a global header file for string resources called dialogs.hrc. Look at
RID_SVXSTR_NEXTFREE which specifies the next free ID. Don't forget to
increase it after you have inserted your IDs.
As string resources are global resources there is otherwise a good
chance that you would create conflicts! You can use your own resource
file for your strings which includes dialogs.hrc. Just look at the other
resource files as an example.

Don't forget to add your resource file to makefile.mk. Otherwise your
resources won't be included into the project resource file.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: About choosing the identifier number for a resource entry

Yan Wu-6
Hi Carsten,

Thanks for your answer. It works well as your suggestion.

Regards,
Yan

On 7/14/10, Carsten Driesner <[hidden email]> wrote:

> Yan Wu wrote:
>> Hi,
>>
>> I created a new hrc & src in svx/source/tbxctrls to define a resource
>> entry for the string 'Find' of Find Toolbar(some other strings will also
>> be defined later). The new hrc is defined as:
>> #define RID_SVXSTR_FINDBAR_FIND 1
>>
>> , and the src is defined as:
>> String RID_SVXSTR_FINDBAR_FIND
>> {
>>    Text [ en-US ] = "Find" ;
>> };
>> There would be a compiling warning "Global resources should have an
>> identifier >= 256", so I changed 1 to 256. Will this number(256) be
>> conflicted with other identifier number? How to choose the identifier
>> number when defining a resource entry?
> Hi Yan,
>
> Please don't use a separate header file for your string resources. There
> is a global header file for string resources called dialogs.hrc. Look at
> RID_SVXSTR_NEXTFREE which specifies the next free ID. Don't forget to
> increase it after you have inserted your IDs.
> As string resources are global resources there is otherwise a good
> chance that you would create conflicts! You can use your own resource
> file for your strings which includes dialogs.hrc. Just look at the other
> resource files as an example.
>
> Don't forget to add your resource file to makefile.mk. Otherwise your
> resources won't be included into the project resource file.
>
> Regards,
> Carsten
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]