Run your application under a debugger and see where it crashes.