Skip to content

Latest commit

 

History

History
59 lines (33 loc) · 1.83 KB

TPJResourceFile-AddEntry.md

File metadata and controls

59 lines (33 loc) · 1.83 KB

AddEntry methods

Project: Resource File Unit

Unit: PJResFile.

Class: TPJResourceFile

Applies to: ~>1.0

There are two overloaded AddEntry methods. They are both used to create a new resource entry within the resource file represented by a TPJResourceFile object.


function AddEntry(const ResType, ResName: Pchar;
  const LangID: Word = 0): TPJResourceEntry;

Adds a new, empty, resource to the resource file object.

Parameters:

  • ResType: The type of the new resource (ordinal or string).
  • ResName: The name of the new resource (ordinal or string).
  • LangID: Optional language id of the resource (a language neutral value of 0 is used if this parameter is not provided).

Returns:

A reference to the new resource entry. This reference should be used to set the resource headers and to store the raw data.

Raises:

An exception is raised if an entry already exists with same type, name and language id.


function AddEntry(const Entry: TPJResourceEntry; const ResName: Pchar;
  const LangID: Word = 0): TPJResourceEntry;

Adds a copy of an existing resource entry to the resource file object with a new resource name and language id. The new entry has the same resource type as the one being copied.

  • Entry: Reference to the resource entry to be copied.
  • ResName: Name of the new resource.
  • LangID: Optional language id of the resource (a language neutral value of 0 is used if this parameter is not provided).

Returns:

A reference to the new resource entry that has the same header information and data as the one being copied except for the resource name and language id.

Raises:

An exception is raised if an entry already exists with same type, name and language id.