DosQueryMessageCP obtains a list of code page identifiers and language identifiers that are associated with a specified message file.
In the following code fragment code page and language identifiers associated with the message file "D:\MESSAGE\AUTOMSG.MSG" are retrieved.
#define INCL_DOSMISC /* Miscellaneous values */ #include <os2.h> #include <stdio.h> UCHAR ucBufferArea[20]; /* Buffer for the returned list */ ULONG ulBufferLength; /* Length of the buffer area */ UCHAR ucFileName[40]; /* Message file path-name string */ ULONG ulDataLength; /* Length of the returned data */ APIRET ulrc; /* Return code */ strcpy(ucFileName, "D:\\MESSAGE\\AUTOMSG.MSG"); /* Path name of message file */ ulBufferLength = 20; /* Length of buffer area */ ulrc = DosQueryMessageCp(ucBufferArea, ulBufferLength, ucFileName, &ulDataLength); if (ulrc != 0) { printf("DosQueryMessageCp error: return code = %ld", ulrc); return; }
On successful return, the BufferArea buffer contains a set of information concerning the code page identifiers and language identifiers that are associated with the message file.