This example sets the code page for a message queue to 850 if it is not already set.
#define INCL_WINCOUNTRY #include <OS2.H> HMQ hmq; if(WinQueryCp(hmq) != 850) { WinSetCp(hmq, 850); }