UNICODE support in the C++ Standard

The Oxford meeting of the ISO C++ standards committee between 15-20 April resulted in new features beeing into the draft paper of the C++0x standard. One of the features refer to Unicode support: a new header, called <cuchar>, was introduced. This header makes available new built-in types char16_t and char32_t, as well as new prefixes…

Working with the Registry in VC++

Working correctly with the Windows Registry might prove a little difficult, especially for beginners. One thing one should care about for example is using the correct access rights (not just the default ones) when creating a registry key. To ease the burden of directly using the Win32 registry API, I decided to wrap them inside…

Debugging and Exception Handling

Suppose you have the following code:

When running the program, the following window is popped up: When running it in the debugger, a different window is popped up: and the debugger takes you to the line of code that threw the exception. Looking into the output window, you can see something like this: First-chance…

LINQ to SQL

LINQ to SQL is an API that allows querying relational databases. The samples in this post are based on the concepts of: Entity classes (which are instances of Entity Types). Such a class is a regular .NET class that is decorated with the attribute Table and its properties and fields with the attribute Column DataContext,…

LINQ to XML

LINQ offers an API called LINQ to XML, formally known as XLinq, that provides support for working with XML. This API resides in the System.Xml.Linq namespace, and you need to add a reference to the assembly with the same name to be able to use it. If you installed the Orcas March CTP bits, the…

yield keyword and lazy evaluation in C#

yield is a new contextual keyword introduced to C# 2.0, vital for lazy evaluation and the performance of queries in LINQ. Being a contextual keyword means that yield can be used as a variable name in C# without any problem. When put before return it becomes a keyword. yield allows one enumerable class to be…