“Error 126 happened when doing foo”? How about “Error 126 (The specified module could not be be found) when doing foo”? That’s what this next code sample demonstrates.
C++ Utility Code Series
I’ve been going through some old “utility code” that I wrote in the past, and realized I spent a lot of time trawling through MSDN documentation and random blog posts to assemble these utility functions. Most of these functions never existed in full in any one spot so I figured I should document these solutions…… Continue reading C++ Utility Code Series
How to expose C# async methods in WinRT components
When authoring Windows Runtime (WinRT) components with C# you cannot use the standard C# async Task pattern. Say for example you have code like: public sealed class MyComponent { public async Task<string> SaveToFile(StorageFolder folder, string fileName) { var file = await folder.CreateFileAsync(fileName); var output = MakeRandomString(128); await FileIO.WriteTextAsync(file, output); return output; } } Visual Studio…… Continue reading How to expose C# async methods in WinRT components
Embedding user defined resources in Visual C++ binaries
For my current project I wanted the ability to package my entire C++ project (dependent DLLs and data files) as a single Windows executable. To do this I had to find a way to embed the data files into the executable at build time. There’s multiple ways to do this. I settled on using the…… Continue reading Embedding user defined resources in Visual C++ binaries
Redirecting standard output to console in Windows
When I first started making Windows programs in the early 2000s I needed a way to display logging information visually to the user. With some internet sleuthing I discovered how to create a windows console and using black magic, how to redirect the standard input/output streams to print to this window. With that problem solved…… Continue reading Redirecting standard output to console in Windows
Hello World Redux
Well, it’s been awhile. I took a long hiatus from the online world over the last nine months or so. In that time, I took a big interest in online services (aka the CLOUD), married the most wonderful women in the world, left the game development world and joined the borg Microsoft, moved three thousand…… Continue reading Hello World Redux
GUID Generator
I love it when I need to whip up a quick application that solve a problem, and I have the time to play with something new. Or in this case, something very old. Recently I needed a tool that can generate GUIDs on the fly for me. Sure, there’s a bunch of online websites filled…… Continue reading GUID Generator
Getting rid of C#’s obj folders
A small tip for developers who are irritated with Visual Studio doing this to your pristine source tree: To get the obj directories out of your source tree, and somewhere nicer (your project’s build output directory for example) open up your project’s .csproj file in an external editor. Locate any line that has the <OutputPath>…… Continue reading Getting rid of C#’s obj folders
Hailstorm: First Version Tagged
Well, I know its not much… but I figured I should start writing about all my programming (and non-programming) exploits more regularly. A lot of these are going to be shorter status updates, since I may not always have that much to write about. At least I’m going to get back in to the habit.…… Continue reading Hailstorm: First Version Tagged
Printing Generic C++ Containers
Always wanted a simple utility function to print our an arbitrary STL container? Well, so long as your container type support directional iterators… this method I wrote will work perfectly! Its a great example for why templates are awesome #include <sstream> template<typename T> std::string dumpContainer( const T& container, std::string sep ) { typename T::const_iterator itr;…… Continue reading Printing Generic C++ Containers