Accessing SQLite databases in C++ using SOCI

I recently decided to use SOCI and SQLite at work and found that neither there is not a super straight forward path for setting this up. As of SOCI version 3.0.0 there is no support for Visual Studio 2008, so I had to convert and fix a few bugs resulting from that. There were some path issues as well. Also they don’t package the SQLite interface with SOCI so you have to checkout the repo to get access to it. After getting that there are still a few snags, not to mention actually setting up SQLite as a library.

[Updated: 10/13/2009]
After writing this article the SOCI team has resolved some of these issues, so some of these steps are no longer necessary.

Read More

Setting up a Symbol Server for Visual Studio 2008

Debugging an application after its been released can be a total pain.  So, over time I’ve collected some software and techniques for making it a bit easier on myself and my team.  We ship our product with a modified version of  Hans Dietrich’s XCrashReport to provide logs, system information, and minidumps when our application inevitably crashes. If you’re not already using something similar I would highly recommend checking it out.

This utility sends us lots of crash dump files and until now we’ve always had to dig back through our archives to find the corresponding symbols and source code. But today I decided to rid us of the headache and set up a Symbol Server that could automatically determine our version and load it into Visual Studio 2008. The documentation can be a bit lacking at times, so I will try to illuminate the path that I took.

Step 1:
Download Debugging Tools for Windows. This provides you with symstore.exe which will be important for creating the symbol store.

Step 1.5:
Add the Debugging Tools directory to your path, so we have access to symstore.exe.

Step 2:
Create a folder on your build server and share it such that you have something like \\BuildServer\Symbols available to your workstation.

Step 3:
For each build, execute a command like

symstore.exe add /r /p /f U:\Project\Bin\*.* /s \\BuildServer\Symbols /t “My Project” /v “Build 42”

Where U:\Project\Bin is the directory with your .pdb files, \\BuildServer\Symbols is obviously the symbols directory, “My Project” is the name of the project, and “Build 42” is the description of the version.

Step 4:
Open Visual Studio 2008,  go to Tools->Options->Debugging->Symbols. Set your cache directory to something like C:\SymbolCache, then add the location of the new symbol store: \\BuildServer\Symbols.

Step 4.5:
At this point, it would be advisable to add the Microsoft Symbol Store to the locations list too:

This should facilitate debugging crash dumps without tracking down the symbols. Also, check out the Source Server which will access your VCS system to pull out the correct source code files for you automatically too.

Read More

Please stop cluttering inboxes, start blogging

There are still lots of people out there who continue to send far too many emails to friends, coworkers, family, etc. Many of these emails are usually mass-forwards to laundry lists of people. While I’m sure some of these are quite amusing/interesting/inflammatory, they all frequently have the same effect:  clutterying up inboxes.

To these people, I would like to  suggest they do what so many other net-savvy people have done, specifically blogging. Blogging is essentially the same thing as sending out that armada of email, except that it is seen when and how the end user desires. If you haven’t quite figured out the whole blog thing, or think that its too technical, rest assured its actually quite simple. In fact, websites like WordPressblogspot, and livejournal do all the work for you. And this tutorial explains how to get started on your new blogging adventure.

After you’ve created your new blog, don’t immediately send out a barrage of ‘Check out my new Intarweb!’ emails.  First try to find your friends’ blogs and comment on them, leaving a link to your own.  Its a little more polite.

Don’t think you need to abandon your friendly emails though, these can still be quite pleasant when not sent in bulk. A few rules of thumb for writing a blog instead of an email:

  1. Is your mailing list large enough that you need to use BCC?
  2. Do you have to think about to whom you want to write the email?
  3. Does it envolve sending an image or video?
  4. Are there more people than just your recipients that might find the email interesting?

If you found this useful, then you might also do a quick google on RSS or go take a peek at Google Reader. Most blog platforms allow you to subscribe using RSS and use software like Google Reader to read all your blogs in one simple interface.

Read More