typedef struct _COUNTRYCODE { /* ctryc */ USHORT country; /* country code */ USHORT codepage; /* code page */ } COUNTRYCODE; typedef struct _COUNTRYINFO { /* ctryi */ USHORT country; /* country code */ USHORT codepage; /* code page */ USHORT fsDateFmt; /* date format */ CHAR szCurrency[5]; /* currency indicator */ CHAR szThousandsSeparator[2]; /* thousands separator */ CHAR szDecimal[2]; /* decimal separator * / CHAR szDateSeparator[2]; /* date separator */ CHAR szTimeSeparator[2]; /* time separator */ UCHAR fsCurrencyFmt; /* bit fields for currency format */ UCHAR cDecimalPlace; /* currency decimal places */ UCHAR fsTimeFmt; /* Time format (AM/PM or 24 hr) */ USHORT abReserved1[2]; /* reserved (0) */ CHAR szDataSeparator[2]; /* Data list separator */ USHORT abReserved2[5]; /* reserved (0) */ } COUNTRYINFO; #define INCL_DOSNLS USHORT rc = DosGetCtryInfo(Length, Structure, MemoryBuffer, DataLength); USHORT Length; /* Length of data area provided */ PCOUNTRYCODE Structure; /* Input data structure */ PCOUNTRYINFO MemoryBuffer; /* Country information (returned) */ PUSHORT DataLength; /* Length of data (returned) */ USHORT rc; /* return code */
Example
This example gets country-dependent information.
#define INCL_DOSNLS #define CURRENT_COUNTRY 0 #define NLS_CODEPAGE 850 COUNTRYCODE Country; COUNTRYINFO CtryBuffer; USHORT Length; USHORT rc; Country.country = CURRENT_COUNTRY; Country.codepage = NLS_CODEPAGE; rc = DosGetCtryInfo(sizeof(CtryBuffer), /* Length of data area provided */ &Country, /* Input data structure */ &CtryBuffer, /* Data area to be filled by function */ &Length); /* Length of data returned */