dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosGetCp (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSNLS
 
USHORT DosGetCp(cbBuf, pusBuf, pcbCodePgLst)
USHORT cbBuf;            /* number of bytes in buffer for list        */
PUSHORT pusBuf;          /* pointer to buffer receiving list          */
PUSHORT pcbCodePgLst;    /* pointer to variable receiving list length */
 
The DosGetCp function retrieves a list that contains the current code page
for the process and all prepared system code pages. The code-page list
consists of one or more 16-bit values, each value representing a code-page
identifier. The first value in the list is the identifier for the process's
current code page. A process can set its current code page by using the
DosSetCp function. Otherwise, the process inherits its current code page
from its parent process.
 
The DosGetCp function copies the code-page list to a buffer. If the buffer
is too small to hold all the information, DosGetCp truncates the
information. If the buffer is larger than the information, DosGetCp fills
any remaining bytes with zeros.
 
Parameter     Description
────────────────────────────────────────────────────────────────────────────
 
cbBuf         Specifies the length (in bytes) of the buffer for the
              code-page list.
 
pusBuf        Points to the buffer that receives the code-page list.
 
pcbCodePgLst  Points to the variable that receives the number of bytes
              copied to the code-page list.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value.
 
Comments
 
The code-page identifier can be one of the following values:
 
Number  Code page
────────────────────────────────────────────────────────────────────────────
437     United States
 
850     Multilingual
 
860     Portuguese
 
863     French Canadian
 
865     Nordic
 
If DosGetCp cannot return the code page, you can get the code page by
calling DosGetCtryInfo with a value of 0 for both the country and codepage
fields of the COUNTRYCODE structure.
 
See Also
 
DosSetCp