Jump to content

DosQueryMessageCP: Difference between revisions

From EDM2
Created page with "==Description== Retrieves a message file list of code pages and language identifiers. ==Syntax== <PRE> #define INCL_DOSMISC #include <os2.h> PCHAR pb; /* Poin..."
 
Ak120 (talk | contribs)
No edit summary
Line 7: Line 7:
#include <os2.h>
#include <os2.h>


PCHAR    pb;          /* Pointer to the caller's buffer area. */
PCHAR    pb;          /* Pointer to the caller's buffer area. */
ULONG    cb;          /* The length, in bytes, of pb. */
ULONG    cb;          /* The length, in bytes, of pb. */
PSZ      pszFilename;  /* The file specification of the message file. */
PSZ      pszFilename;  /* The file specification of the message file. */
PULONG    cbBuf;        /* Pointer to the ULONG that receives the actual length, in bytes, of the returned data. */
PULONG    cbBuf;        /* Pointer to the ULONG that receives the actual length,  
APIRET    ulrc;        /* Return Code. */
                          in bytes, of the returned data. */
APIRET    ulrc;        /* Return Code. */


ulrc = DosQueryMessageCP(pb, cb, pszFilename, cbBuf);
ulrc = DosQueryMessageCP(pb, cb, pszFilename, cbBuf);
</PRE>


</PRE>
==Parameters==
==Parameters==
;  pb (PCHAR) - output : Pointer to the caller's buffer area.
;  pb (PCHAR) - output : Pointer to the caller's buffer area.
Line 31: Line 32:


DosQueryMessageCP returns one of the following values:
DosQueryMessageCP returns one of the following values:
* 0          NO_ERROR
* 2          ERROR_FILE_NOT_FOUND
* 206        ERROR_FILENAME_EXCED_RANGE
* 318        ERROR_MR_UN_ACC_MSGF
* 319        ERROR_MR_INV_MSGF_FORMAT
* 321        ERROR_MR_UN_PERFORM


* 0          NO_ERROR
* 2          ERROR_FILE_NOT_FOUND
* 206        ERROR_FILENAME_EXCED_RANGE
* 318        ERROR_MR_UN_ACC_MSGF
* 319        ERROR_MR_INV_MSGF_FORMAT
* 321        ERROR_MR_UN_PERFORM
==Remarks==
==Remarks==
DosQueryMessageCP retrieves the message file list of code pages and language identifiers.
DosQueryMessageCP retrieves the message file list of code pages and language identifiers.


The system returns the requested message file list of code pages and language identifiers in the caller's buffer (pb). It has the following format:
The system returns the requested message file list of code pages and language identifiers in the caller's buffer (pb). It has the following format:
Line 59: Line 60:


The following table shows the valid language and sublanguage identifier values. Column 1 is the language family identifier, and column 2 is the sublanguage identifier. Column 3 shows the language, and column 4 shows the principal country for this language.
The following table shows the valid language and sublanguage identifier values. Column 1 is the language family identifier, and column 2 is the sublanguage identifier. Column 3 shows the language, and column 4 shows the principal country for this language.
 
{|class="wikitable"
    ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
!Family||Subl.||Language||Principal country
    ³Family ³Subl. ³Language                  ³Principal country   ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|0||0||null||null
    ³0      ³0      ³null                      ³null                ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|1||1||Arabic||Arab countries
    ³1      ³1      ³Arabic                    ³Arab countries     ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|2||1||Bulgarian||Bulgaria
    ³2      ³1      ³Bulgarian                ³Bulgaria            ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|3||2||Spanish||Spain
    ³3      ³2      ³Spanish                  ³Spain              ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|3||3||Spanish Mexican||Mexico
    ³3      ³3      ³Spanish Mexican           ³Mexico              ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|4||1||Traditional Chinese||Republic of China
    ³4      ³1      ³Traditional Chinese       ³Republic of China   ³
|-
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|4||2||Simplified Chinese||People's Republic of China
    ³4      ³2      ³Simplified Chinese       ³People's Republic of³
|-
    ³      ³      ³                          ³China              ³
|5||1||Czech||Czechoslovakia
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³5      ³1      ³Czech                    ³Czechoslovakia      ³
|6||1||Danish||Denmark
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³6      ³1      ³Danish                    ³Denmark            ³
|7||1||German||Germany
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³7      ³1      ³German                    ³Germany            ³
|7||2||Swiss German||Switzerland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³7      ³2      ³Swiss German             ³Switzerland        ³
|8||1||Greek||Greece
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³8      ³1      ³Greek                    ³Greece              ³
|9||1||U.K. English||United Kingdom
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³9      ³1      ³U.K. English             ³United Kingdom     ³
|9||2||U.S. English||United States
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³9      ³2      ³U.S. English             ³United States       ³
|10||1||Finnish||Finland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³10    ³1      ³Finnish                  ³Finland            ³
|11||1||French||France
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³11    ³1      ³French                    ³France              ³
|11||2||Belgian French||Belgium
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³11    ³2      ³Belgian French           ³Belgium            ³
|11||3||Canadian French||Canada
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³11    ³3      ³Canadian French           ³Canada              ³
|11||4||Swiss French||Switzerland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³11    ³4      ³Swiss French             ³Switzerland        ³
|12||1||Hebrew||Israel
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³12    ³1      ³Hebrew                    ³Israel              ³
|13||1||Hungarian||Hungary
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³13    ³1      ³Hungarian                ³Hungary            ³
|14||1||Icelandic||Iceland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³14    ³1      ³Icelandic                ³Iceland            ³
|15||1||Italian||Italy
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³15    ³1      ³Italian                  ³Italy              ³
|15||2||Swiss Italian||Switzerland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³15    ³2      ³Swiss Italian             ³Switzerland        ³
|16||1||Japanese||Japan
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³16    ³1      ³Japanese                  ³Japan              ³
|17||1||Korean||Korea
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³17    ³1      ³Korean                    ³Korea              ³
|18||1||Dutch||Netherlands
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³18    ³1      ³Dutch                    ³Netherlands        ³
|18||2||Belgian Dutch||Belgium
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³18    ³2      ³Belgian Dutch             ³Belgium            ³
|19||1||Norwegian - Bokmal||Norway
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³19    ³1      ³Norwegian - Bokmal       ³Norway              ³
|19||2||Norwegian - Nynorsk||Norway
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³19    ³2      ³Norwegian - Nynorsk       ³Norway              ³
|20||1||Polish||Poland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³20    ³1      ³Polish                    ³Poland              ³
|21||1||Portuguese||Portugal
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³21    ³1      ³Portuguese                ³Portugal            ³
|22||2||Brazilian Portuguese||Brazil
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³22    ³2      ³Brazilian Portuguese     ³Brazil              ³
|23||1||Rhaeto-Romanic||Switzerland
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³23    ³1      ³Rhaeto-Romanic           ³Switzerland        ³
|24||1||Serbo-Croatian (Cyrillic)||Yugoslavia
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³24    ³1      ³Serbo-Croatian (Cyrillic) ³Yugoslavia          ³
|24||2||Serbo-Croatian (Latin)||Yugoslavia
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³24    ³2      ³Serbo-Croatian (Latin)   ³Yugoslavia          ³
|25||1||Slovakian||Czechoslovakia
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³25    ³1      ³Slovakian                ³Czechoslovakia      ³
|26||1||Albanian||Albania
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³26    ³1      ³Albanian                  ³Albania            ³
|27||1||Swedish||Sweden
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³27    ³1      ³Swedish                  ³Sweden              ³
|28||1||Thai||Thailand
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³28    ³1      ³Thai                      ³Thailand            ³
|29||1||Turkish||Turkey
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³29    ³1      ³Turkish                  ³Turkey              ³
|30||1||Urdu||Pakistan
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³30    ³1      ³Urdu                      ³Pakistan            ³
|31||1||Russian||U.S.S.R.
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|-
    ³31    ³1      ³Russian                  ³U.S.S.R.           ³
|32||1||Catalan||Spain
    ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|}
    ³32    ³1      ³Catalan                  ³Spain              ³
    ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
 


==Example Code==
==Example Code==
Line 190: Line 188:
return NO_ERROR;
return NO_ERROR;
}
}
</PRE>


</PRE>
==Related Functions==
==Related Functions==
* [[OS2 API:CPI:DosGetMessage|DosGetMessage]]
* [[OS2 API:CPI:DosGetMessage|DosGetMessage]]
* [[OS2 API:CPI:DosInsertMessage|DosInsertMessage]]
* [[OS2 API:CPI:DosInsertMessage|DosInsertMessage]]
* [[OS2 API:CPI:DosPutMessage|DosPutMessage]]
* [[OS2 API:CPI:DosPutMessage|DosPutMessage]]


[[Category:The OS/2 API Project]]
[[Category:The OS/2 API Project]]

Revision as of 16:32, 9 July 2016

Description

Retrieves a message file list of code pages and language identifiers.

Syntax

#define INCL_DOSMISC
#include <os2.h>

PCHAR     pb;           /* Pointer to the caller's buffer area. */
ULONG     cb;           /* The length, in bytes, of pb. */
PSZ       pszFilename;  /* The file specification of the message file. */
PULONG    cbBuf;        /* Pointer to the ULONG that receives the actual length, 
                           in bytes, of the returned data. */
APIRET    ulrc;         /* Return Code. */

ulrc = DosQueryMessageCP(pb, cb, pszFilename, cbBuf);

Parameters

pb (PCHAR) - output
Pointer to the caller's buffer area.

This buffer area is where the system returns the requested message file list of code pages and language identifiers.

cb (ULONG) - input
The length, in bytes, of pb.
pszFilename (PSZ) - input
The file specification of the message file.

The drive designation and path are optional. This specifies a file that was previously prepared by the MKMSGF utility program.

cbBuf (PULONG) - output
Pointer to the ULONG that receives the actual length, in bytes, of the returned data.

Return Code

ulrc (APIRET) - returns

DosQueryMessageCP returns one of the following values:

  • 0 NO_ERROR
  • 2 ERROR_FILE_NOT_FOUND
  • 206 ERROR_FILENAME_EXCED_RANGE
  • 318 ERROR_MR_UN_ACC_MSGF
  • 319 ERROR_MR_INV_MSGF_FORMAT
  • 321 ERROR_MR_UN_PERFORM

Remarks

DosQueryMessageCP retrieves the message file list of code pages and language identifiers.

The system returns the requested message file list of code pages and language identifiers in the caller's buffer (pb). It has the following format:

Length        Field 
USHORT       Code page count (N) 
USHORT       Code page identifier. This field occurs N times, once per code page. 
ULONG        Language identifier 

This data structure is repeated for each subfile within the specified message file.

The code page identifier can have the values specified in COUNTRYCODE.

The language identifier is a ULONG. The low-order word identifies a language family, and the high-order word identifies a specific version of that language (a sublanguage).

The language and sublanguage identifier values 0 through 255 are reserved for system use. The values 256 through 511 are reserved for application use.

The MKMSGF utility program performs range checking on the language and sublanguage identifier values. The value 0 means a null or unspecified language or sublanguage. Only the values defined in the following table are valid below 256. Any values from 256 through 511 are valid. Any identifier value greater than 511 is invalid.

The following table shows the valid language and sublanguage identifier values. Column 1 is the language family identifier, and column 2 is the sublanguage identifier. Column 3 shows the language, and column 4 shows the principal country for this language.

Family Subl. Language Principal country
0 0 null null
1 1 Arabic Arab countries
2 1 Bulgarian Bulgaria
3 2 Spanish Spain
3 3 Spanish Mexican Mexico
4 1 Traditional Chinese Republic of China
4 2 Simplified Chinese People's Republic of China
5 1 Czech Czechoslovakia
6 1 Danish Denmark
7 1 German Germany
7 2 Swiss German Switzerland
8 1 Greek Greece
9 1 U.K. English United Kingdom
9 2 U.S. English United States
10 1 Finnish Finland
11 1 French France
11 2 Belgian French Belgium
11 3 Canadian French Canada
11 4 Swiss French Switzerland
12 1 Hebrew Israel
13 1 Hungarian Hungary
14 1 Icelandic Iceland
15 1 Italian Italy
15 2 Swiss Italian Switzerland
16 1 Japanese Japan
17 1 Korean Korea
18 1 Dutch Netherlands
18 2 Belgian Dutch Belgium
19 1 Norwegian - Bokmal Norway
19 2 Norwegian - Nynorsk Norway
20 1 Polish Poland
21 1 Portuguese Portugal
22 2 Brazilian Portuguese Brazil
23 1 Rhaeto-Romanic Switzerland
24 1 Serbo-Croatian (Cyrillic) Yugoslavia
24 2 Serbo-Croatian (Latin) Yugoslavia
25 1 Slovakian Czechoslovakia
26 1 Albanian Albania
27 1 Swedish Sweden
28 1 Thai Thailand
29 1 Turkish Turkey
30 1 Urdu Pakistan
31 1 Russian U.S.S.R.
32 1 Catalan Spain

Example Code

This example queries the the number of code pages and the first code page and language identifier from the file "SAMPLE.MSG". The result of the query has the format specified be the _MYCPINFO structure.

#define INCL_DOSMISC    /* Miscellaneous values */
#define INCL_DOSERRORS  /* DOS Error values */
#include <os2.h>
#include <stdio.h>

int main(VOID) {

typedef struct _MYCPINFO
 {  USHORT       cCP;          /* Number of code pages */
    USHORT       CP1;          /* First code page      */
    ULONG        dtype;
 } MYCPINFO;

UCHAR     uchBuffer[20] = {0};            /* Buffer for the returned list */
MYCPINFO  CPinfo         = {0};           /* Pointer to buffer */
ULONG     ulDataLen      = 0;             /* Length of data returned */
APIRET    rc             = NO_ERROR;      /* Return code */

 rc = DosQueryMessageCP( (PUCHAR) &CPinfo,
                         sizeof(MYCPINFO),
                         "SAMPLE.MSG",
                         &ulDataLen );

 if (rc != NO_ERROR) {
      printf("DosQueryMessageCP error: return code = %u\n", rc);
      return 1;
 } else {
      printf("SAMPLE.MSG:  %u Code Page(s) - Code Page 1 = %u.\n",
                                        CPinfo.cCP, CPinfo.CP1);
 } /* endif */

return NO_ERROR;
}

Related Functions