Showing posts with label windows programming. Show all posts
Showing posts with label windows programming. Show all posts

Thursday, January 31, 2008

The world of wide characters aka Unicode

Wide characters aka unicode characters are characters that occupy 16 bits per character .
In C we have a header file specifically for that .



that contains special data type for that

wchar_t

wchar_t * text = L"Hello";

is used to tell the compiler that it should use 16 bit aka wide variants of characters.

strlen for wide characters becomes wcslen .

To take care of these problems windows provides TCHAR.H

it contains many functions starting with _t , like. ..

_tprintf


by defining _UNICODE

like

#define _UNICODE

its possible to use 16 bit / 8 bit versions of functions without much verbosity .

the same _t functions then correctly map on to their 8 bit and 16 bit counter parts.

Tuesday, January 15, 2008

Hello Windows Facts

windows.h is the mother of all other header files in windows . It includes other header files .

Windef.h => basic type defintions

winnt.h => type definitions for unicode support.

winbase.h => kernel functions.

winusr.h => user interface functions

wingdi.h => graphics device interface functions.

WINAPI => is a naming convention like __stdcall .

Labels

. linux (1) algorithm (15) analytics (1) bash (2) bigoh (1) bruteforce (1) c# (1) c++ (40) collections (1) commands (2) const (1) cosine similarity (1) creating projects (1) daemon (1) device_drivers (1) eclipse (6) eclipse-plugin-development (9) equals (1) formatting (1) freebsd (1) game programming (1) hashcode (1) heap (1) heaps (1) immutable-objects (1) java (19) JDT (1) kernel (1) linux (4) little sugar (23) logging (1) machine learning (1) marker-resolution (1) markers (1) mergesort (1) mixins (1) numbers (1) opengl (2) patterns (2) priority-queue (1) programming (51) ps (1) ranking (1) refactoring (3) references (1) security (1) set (1) shell (1) similarity (1) statistics (1) stl (1) tetris (1) threads (1) trees (2) unicode (1) unix (2) views (2) windows programming (2) XNA (1)