The following code is causing an intermittent crash on a Vista machine.
using (SoundPlayer myPlayer = new SoundPlayer(Properties.Resources.BEEPPURE))
myPlayer.Play();
I highly suspect it is this code because the prgram crashes mid-beep or just before the beep is played every time. I have top-level traps for all ThreadExceptions, UnhandledExceptions in my app domain, and a try-catch around Application.Run, none of which trap this crash.
Any ideas?
EDIT:
The Event Viewer has the following information: Faulting application [xyz].exe, version 4.0.0.0, time stamp 0x48ce5a74, faulting module msvcrt.dll, version 7.0.6001.18000, time stamp 0x4791a727, exception code 0xc0000005, fault offset 0x00009b30, process id 0x%9, application start time 0x%10.
Interestingly, the HRESULT 0xc0000005 has the message: "Reading or writing to an inaccessible memory location." (STATUS_ACCESS_VIOLATION)