DosSetProcessCp: Difference between revisions
Appearance
Created page with "==Description== Allows a process to set its code page. ==Syntax== <PRE> #define INCL_DOSNLS #include <os2.h> ULONG cp; →A code page identifier.: APIRET ulrc; ..." |
mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Allows a process to set its code page. | Allows a process to set its code page. | ||
==Syntax== | ==Syntax== | ||
DosSetProcessCp(cp) | |||
==Parameters== | ==Parameters== | ||
; cp (ULONG) - input : A code page identifier. | ;cp (ULONG) - input : A code page identifier. | ||
:Possible values are shown in the [[Code pages|list]]. | |||
==Return Code== | ==Return Code== | ||
;ulrc (APIRET) - returns:DosSetProcessCp returns one of the following values: | |||
*0 NO_ERROR | |||
DosSetProcessCp returns one of the following values: | *472 ERROR_INVALID_CODE_PAGE | ||
* | |||
* 472 | |||
==Remarks== | ==Remarks== | ||
DosSetProcessCp sets the process code page of the calling process. The code page of a process is used in the following ways: | DosSetProcessCp sets the process code page of the calling process. The code page of a process is used in the following ways: | ||
# The printer code page is set to the process code page through the file system and printer spooler (the system spooler must be installed) when the process makes a request to open the printer. Calling ''DosSetProcessCp'' does not affect the code page of a printer opened prior to the call, and does not affect the code page of a printer opened by another process. | |||
# Country-dependent information, by default, is retrieved encoded in the code page of the calling process. | |||
# A newly-created process inherits its process code page from its parent process. | |||
DosSetProcessCp does not affect the display or keyboard code page. | DosSetProcessCp does not affect the display or keyboard code page. | ||
Line 62: | Line 27: | ||
#include <os2.h> | #include <os2.h> | ||
#include <stdio.h> | #include <stdio.h> | ||
int main(VOID) { | int main(VOID) { | ||
Line 76: | Line 40: | ||
return NO_ERROR; | return NO_ERROR; | ||
} | } | ||
</PRE> | |||
==Related Functions== | ==Related Functions== | ||
* [[ | *[[DosMapCase]] | ||
* [[ | *[[DosQueryCollate]] | ||
* [[ | *[[DosQueryCp]] | ||
* [[ | *[[DosQueryCtryInfo]] | ||
* [[ | *[[DosQueryDBCSEnv]] | ||
[[Category: | [[Category:Dos]] |
Latest revision as of 17:18, 12 October 2018
Allows a process to set its code page.
Syntax
DosSetProcessCp(cp)
Parameters
- cp (ULONG) - input
- A code page identifier.
- Possible values are shown in the list.
Return Code
- ulrc (APIRET) - returns
- DosSetProcessCp returns one of the following values:
- 0 NO_ERROR
- 472 ERROR_INVALID_CODE_PAGE
Remarks
DosSetProcessCp sets the process code page of the calling process. The code page of a process is used in the following ways:
- The printer code page is set to the process code page through the file system and printer spooler (the system spooler must be installed) when the process makes a request to open the printer. Calling DosSetProcessCp does not affect the code page of a printer opened prior to the call, and does not affect the code page of a printer opened by another process.
- Country-dependent information, by default, is retrieved encoded in the code page of the calling process.
- A newly-created process inherits its process code page from its parent process.
DosSetProcessCp does not affect the display or keyboard code page.
Example Code
This example sets the code page of the process to 850.
#define INCL_DOSNLS /* National Language Support values */ #define INCL_DOSERRORS /* DOS Error values */ #include <os2.h> #include <stdio.h> int main(VOID) { APIRET rc = NO_ERROR; rc = DosSetProcessCp(850); if (rc != NO_ERROR) { printf("DosSetProcessCp error: return code = %u\n", rc); return 1; } return NO_ERROR; }