|
|
Microsoft OS/2 SDK 03-01-1988
/*
* Example of DosGetCtryInfo usage
*
* This routine is an example of how to get country dependant
* information. This program works Family API. IMPORTANT NOTE: In order
* to run this in Family API under DOS 2/3 you must put a copy of the
* OS/2 file "country.sys" in the root directory of your boot drive.
*
* Compile as: cl -AL -Lp -G0 country.c
*
* Created by Microsoft Corp. 1986
*/
#define INCL_DOSNLS
#define INCL_DOSPROCESS
#include <os2def.h>
#include <bsedos.h>
main()
{
COUNTRYCODE CountryCode; /* Numeric code for country */
COUNTRYINFO Buffa; /* Buffer to receive country info */
USHORT DataLength; /* Length actually copied into buffer */
/*
* Get current country code and related information.
* DosGetCtryInfo will return an error code if LENGTH
* is less than the actual amount of information,
* however as much information as possible will be
* copied to MemoryBuffer.
*
* CountryCode = 0 means return current info, else
* return info for a particular code.
*/
CountryCode.country=0;
CountryCode.codepage=0;
DosGetCtryInfo(sizeof(Buffa), &CountryCode, &Buffa , &DataLength);
/* Display current country code and currency symbol */
printf("Current country code: %d\n", CountryCode.country);
printf("Currency Indicator: %s\n", Buffa.szCurrency);
DosExit(EXIT_PROCESS,0);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.