Tuesday, June 28, 2022

Setting and Retrieving IPv6 Configuration

Unlike IPv4, configuring and retrieving IPv6 information on a PC can be daunting. Depending on the configuration, multiple IP address might be returned by an IPv6 host.

IPV6Configurator tries to address this.

Details
The Adapters lists all available ethernet adapters.

Retrieving
Currently configured Ip addresses for DHCP/Manual for IPv4 and IPv6 are displayed

Setting
Netsh is used for configuring IP addresses.
In case of DHCP, only IP address is needed.

In case of manual configuration,  An IP address is needed. For IPv4, Subnet  and Gateway (optional) configuration are applicable. For IPv6  Prefix Length and Gateway(optional) configuration is applicable. Also "Update Router Discovery" disables the IPv6 host from sending nearest router discovery packets to the network.

Source and Binaries can be found here.

Sunday, June 5, 2022

Supporting Chinese, Japanese and Korean (CJK) languages in MBCS C++ Applications

There are plenty of  MBCS based legacy MFC applications out there that require CJK language support. Migrating to Unicode is not an option in these cases.

All the resources such as menus, dialogs, string tables used by the application are defined in the .rc file. 
However this rc file will not be a part of  the application. It will be part of  separate resource only DLL known as satellite Dll, There will be one satellite Dll for each  language supported by the application.  The main application just loads the satellite dlls for the current code page and avails the resources such as  menus, dialogs, string tables.

Steps for setting language
1. For MBCS applications, the correct code page i.e,  Japanese, chinese traditional or simplified, should be first set in the control panel.as shown below. The system should be restarted.

2.The .RC file must be encoded in the correct format as shown in the table below:
Japanese                        ShiftJIS
Chinese Traditional       Big5
Chinese Simplified        GB312

3. Language specific changes should be made in the RC file. An example for Japanese is shown below.

4. Use Unicode Win32 APIs for rendering.
Sometimes some special characters such as subscript and superscript  are not rendered correctly as they are not available in the codepage. In such cases Unicode Win32  apis can be used in the subclassed controls such as radio buttons.

Source and Binaries can be found here.