473,569 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debugger Error in VC++.NET

ziv
I am encountering a very strange error
Openning a Visual C++/Win32 Console project with mfc support, writing a simple Sleep(5000) function in the main and running the app in Debug mode (default settings). while closing the app in the middle of execution (click on the close window button) i am getting the following error
"Unhandled exception at 0x7c29ed41 (mfc71d.dll) in test2.exe: 0xC0000005: Access violation reading location 0xf78b78e8.

This behavior occurs only in debug mode configuration

We are encountering many problems in porting our code from VC6 to VC++.NET but we would like to solve this first..

Running Visual Studio.NET 7.1.3088, .NET Framework 1.1.4322 SP1, on Windows2000 Professional, SP

thanks in advance, ziv

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #1
1 2135
I am encountering a very strange error:
Openning a Visual C++/Win32 Console project with mfc support, writing a simple Sleep(5000) function in the main and running the app in Debug mode (default settings). while closing the app in the middle of execution (click on the close
window button) i am getting the following error: "Unhandled exception at 0x7c29ed41 (mfc71d.dll) in test2.exe: 0xC0000005: Access violation reading location 0xf78b78e8."
This behavior occurs only in debug mode configuration.

We are encountering many problems in porting our code from VC6 to VC++.NET but we would like to solve this first...

Running Visual Studio.NET 7.1.3088, .NET Framework 1.1.4322 SP1, on Windows2000 Professional, SP4


When you click Close button, the default handler for the event calls ExitProcess,
thus triggering MFC cleanup. The problem is that the system starts a new thread
to call the handler, and therefore the cleanup is made on that thread, not on
the main thread (which is killed by ExitProcess by that time).

The solution is to register your own handler for Close, Ctrl-C and Ctrl-Break events
(using SetConsoleCtrlH andler function), handle these events and ask your main thread
to exit cleanly.

Regards,
Oleg


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1303
by: A C | last post by:
Hi Can someone explain why the following is happening. ProjectA <-- depends on B, C, .... ProjectB ProjectC... etc Project B contains b.cpp and b.h. Also has conditional compiler directive which is NOT present in ProjectA ProjectA includes b.h
8
1417
by: mrelectron | last post by:
hi: Nir Aides who wrote the rpdb debugger has enhanced it and stuck a frontend on it whoo-hoo. it is fantastico! see and download it at http://www.digitalpeers.com/pythondebugger/ cheers mark
6
7578
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module. Additional information: Unverifiable assembly 'FrameGrabber' failed policy check. The FrameGrabber assembly is a C++ managed DLL.
1
1530
by: Boris Dynin | last post by:
Hi, I have some projects (native - not managed code) in VC++ 2003. I'm trying to debug that stuff on Win98 system that has VC6.0 installed. Is it possible to use VC6.0 for debugging code built with VC++ 2003? I know that remote debugging with VS 2003 can be used in this scenario. However, it would be easier for me to use VC6.0. Thanks...
9
2305
by: RalphTheExpert | last post by:
I'm getting different behavior if my code is running under the debugger or not. I have modified Winmain to look like this: // Copyright (C) 2002 Microsoft Corporation // All rights reserved. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER // EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE...
5
2456
by: thomas1107 | last post by:
I am running Visual Studio .NET 2002 Professional on Windows 2000 SP4. When I try to launch the debugger from inside the IDE for VC++ applications I get the following error “Application failed to initialize properly (08x0000003). Click on OK to terminate the application”. I get the same results when I right-click on application and...
2
2872
by: Chris Stiefeling | last post by:
Hi, I am experiencing a strange problem. I am reading and writing xml files via XmlDocument and XmlTextWriter. In the debugger everything works fine but outside the debugger (debug or release) I receive the following error: "The type initializer for "System.Xml.Schema.Validator" threw an exception." I wrote a small console app that...
2
3384
bartonc
by: bartonc | last post by:
Perhaps this belongs in Techie Talk, but I thought one of you all might have some suggestions: I have VC++ Express installed on my development machine. I don't use it often, but the compiler is needed sometimes. Because it is installed, any program crash causes a popup telling me that I should use VC++ menu to turn on the debugger instead of...
5
2484
by: Zytan | last post by:
I cannot stand being unable to change the code while the debugger is running. Is there a way to do this? thanks, Zytan
20
2614
by: =?Utf-8?B?V0o=?= | last post by:
I have a VC++ application that just crashes on one tester/client's machine. It runs fine everywhere else. What are the other options to debug (on the client's machine) without installing VC++ (on the clinet's machine)? Is this possible at all? Thanks. WJ
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.