CGXProperties::AddToken

int

ddToken(LPCTSTR sz);

sz

Pointer to a string with the token text, e.g., “$D”.

Return Value

Returns a unique index for the token. This index will later be passed to SubstTokenText when interpreting tokens.

Remarks

Call this method to register additional tokens, as for example “$D” for the current date. You can interpret this token at run time by overriding SubstTokenText.

The end user can employ tokens when specifying the header/footer at run time. For example, “$d” will be replaced with the current date. If you want to provide more tokens for the end user, you should subclass CGXProperties and override the SubstTokenText method. See this method for further details.

Predefined tokens are:

  • $F: File name of the document

  • $A: Application name

  • $P: Page number

  • $N: Number of pages

  • $D: Date – you can specify the date formatting with an additional parameter, as for example $D{%h:%m}

  • $R: Register / Tabsheet name (if grid is used in a workbook).

CGXProperties

 Class Overview |  Class Members