Jump to content

DosQueryMessageCP

From EDM2
Revision as of 17:28, 20 June 2016 by Martini (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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