First Chance Exception
-
Hi All, I am a newbie to visual C++ and .NET. I am working on a project which involves Visual C++ , MFC. I have an application and when I compile and run it I get a bunch of: First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MpApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. I have no idea why this happens and do not know how to go about debugging this. Also after showing all this exception my application runs fine. I made changes to the Debugger to break into the code on the exception and the first exception occurs in a windows file oleinit.cpp at the line: SCODE sc = ::OleInitialize(NULL); Please give me some guidance/pointers of what to do. Thanks to All
-
Hi All, I am a newbie to visual C++ and .NET. I am working on a project which involves Visual C++ , MFC. I have an application and when I compile and run it I get a bunch of: First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MpApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c017. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. First-chance exception at 0x7c81f070 in MyApp.exe: 0xC0000005: Access violation reading location 0x0000c019. I have no idea why this happens and do not know how to go about debugging this. Also after showing all this exception my application runs fine. I made changes to the Debugger to break into the code on the exception and the first exception occurs in a windows file oleinit.cpp at the line: SCODE sc = ::OleInitialize(NULL); Please give me some guidance/pointers of what to do. Thanks to All
The short answer: Never mind first-chance exceptions. They are not bugs. They are just what it says: a first chance to handle an exception. They will be send to you to give you an opportunity to handle the exception before the framework gets to it, but I have never seen a case where I needed to deal with a first-chance exception. They will usually be handled quite sufficiently by the framework. The exceptions you get are probably due to memory being allocated but not committed, or memory not being allocated yet. My guess is that OleInitialize uses these exceptions in its memory allocation scheme and that they are part of normal execution. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"