Further to the other solutions I can recommend the Windows SysInternals suite of tools - see
http://technet.microsoft.com/en-us/sysinternals/bb545021.aspx[
^] - they're free.
In this instance I would (personally) load up Process Monitor (ProcMon) - it's reasonably intuitive to use plus there's loads on info on the link above. You don't need to make any changes to your program. I often use it to work out what's going wrong with 3rd party stuff and logging can only take you so far
You should be able to determine exactly what was happening when the error happened - you can filter for particular program names and turn on/off views of registry access, file access etc.
Hint: There is a fair amount of "noise" produced when the error message itself is being displayed ... you'll need to page up the results a bit