Windows programming recipes

See also: all the recipes and the intro # How to: Convert Between Various String Types http://msdn.microsoft.com/en-us/library/ms235631.aspx # Project.json info for Core .NET build https://github.com/aspnet/Home/wiki/Project.json-file # To find the available CoreCLR packages, search on http://www.nuget.org/ # how to build for CoreCLR: # pull the dependencies in a directory with project.json dotnet restore # needed every…

0

how to run arbitrary commands as a service

I want to show how to run the arbitrary commands as a service, even a PowerShell script if you want. This started with Core .NET that currently doesn’t have the classes that support the services (although hopefully they will be added in the future). But overall I find pretty annoying that there is no easy…

0

Error handling part 6: ETW logging example

<< Part5 I want to show an example of how to do the error logging through ETW, for the error objects described in the Part 5. It goes against some of the commonly accepted ETW principles but I think that it would out better this way. I think that these commonly accepted ETW principles are…

0

localization both ways

The localization of messages on Windows is done through the MUI files. I.e. aside from mycmd.exe or mylib.dll you get the strings file mycmd.exe.mui or mylib.dll.mui, to be placed next to it in a subdirectory named per the language, like “en-us”, and the system will let you open and get the strings according to the user’s…

0

Error handling, part 5: an error infrastructure for Windows

<<Part 4  Part 6>> Overview The first error infrastructure I’ve done was for my Triceps project. Its description can be found in the Triceps manual. It has proven itself so convenient and useful that I wanted something similar on Windows. And that Windows implementation is what I want to describe here. Some of the features…

0

Error handling, part3: the ETW way

<< Part 2 Part 4>> The Part 2 ended with the summary: In a good error reporting system, the errors should have both the types/codes for the automatic handling and the free-form human-readable strings with the detailed description. However there is one more way, a sort of “middle” way, that is used by the Event Tracing…

0

Error handling, part 2: error types

<< Part 1  Part3 >> Over the years I’ve seen various error handling conventions and systems, and even have written a couple of them myself. I’ve done one for Triceps, with support for C++ and Perl, and another one for C++ on Windows, that I plan to show and discuss in detail in the later…

0