A known bug with a Windows XP security update KB978037 can occur with Visual Studio 2005 (and 2008) where sometimes if you restart a debugging session on a console app then the console window doesn't get closed even though the owner process no longer exists. The problem is discussed further here:
Visual studio debug console sometimes stays open and is impossible to close
These zombie windows then can not be closed via the Taskbar or via the TaskManager, and typically require a power off/on to get rid of them. Over the period of even a single day you can accumulate quite a few of them, which clog up your TaskBar and are generally annoying.
I thought I would knock up a simple C++ Win32 utility to attempt to call DestroyWindow() on these windows by passing the windows handle as a cmd-line argument and converting it to a HWND.
I'm converting the handle from a string by parsing it as a DWORD then casting the DWORD to a HWND. This appears to be working as if I call GetWindowInfo() on the handle it succeeds. However calling DestroyWindow() on the handle fails with error 5 (access denied), presumably because the caller process (i.e. my app) doesn't own the window in question.
Any ideas as to how I might get rid of the zombie windows, either via the above approach or any other alternative short of rebooting? I'm in a corporate environment so installing/uninstalling updates/service-packs etc isn't an option.
Microsoft's hot fix for Windows XP and Windows 2003
I know this is not what you want to hear but the only way to get rid of these windows is by rebooting the computer
Apparently the windows team is trying to fix it:
http://blogs.msdn.com/debugger/archive/2010/03/11/help-my-console-windows-won-t-go-away.aspx
but not much seems to be happening
This issue is still a problem with Visual Studio 2010 on Windows 7!
See this thread
Related
I have the following bug in a program:
An MDI MFC program closes silently on Windows 7 (terminates the process without prompting to save changes and without displaying any "crash" dialog) when the user performs this operation : Click a context menu item.
But this happens only on that PC, at least, for the moment. No other PC has encountered that problem. However the bug can always be reproduced following the same steps but only on that PC.
I want to know the reason but probably the customer won't allow me to install many programs to debug, so I need to be able to log when the program terminates, or print the stack in Release version but I'm quite lost.
I had faced a similar bug before and eventually I fixed it logging line by line and changing the problematic part, but I guess there are much better ways to find bug reasons than this.
I have tried on my development PC to create minidumps on Release mode but if there is no exception thrown on that PC, (I haven't confirmed that yet, though...) maybe it's pointless.
Also used an available class on codeproject (Stackwalker) but I don't manage to print all the function calls. Only on simple console programs, but not on MDI or even SDI.
Any ideas on how to find out the reason? Thanks in advance.
I've been fighting this little problem for a while now, so I'm really hoping I can get some help. I've been looking for a solution to this, and I found this SO question: Debugging doesn't start.
My issue is somewhat similar to the issue discussed here, except that my issue is a two-parter.
Part 1: Similar to the issue discussed on the other question. (Debug Window Doesn't show up)
When I attempt to launch my Windows 32 console application project (The simple kind that opens in the windows CLI). The CLI (or CMD) window doesn't open, and windows idles giving me a spinning cursor wheel. Visual Studio IDE (I'm using VS 2013 Community) becomes unresponsive and I cannot access any menus, or use any hotkey to "Stop Debugging". One difference from the provided SO question though, is that when I try to launch "MyProject.exe" from my project's "Debug" folder I get the same result as attempting to debug in the IDE.
Part 2: Unkillable Process
When I try to close my debug application in the windows task manager, it is not listed as an ongoing process. However, whenever I try to manipulate, delete, or otherwise modify my Project.exe application (in my Project's "Debug" folder), windows informs me that the application is in use. Confused by this, I downloaded two applications. The first was Process explorer, which showed me that I did in fact have 2 instances of "MyProject.exe" running. The second was Process Hacker, which also showed me 2 instances of "MyProject.exe". However, neither of these programs were able to terminate either of the "MyProject.exe" processes.
I am capable of terminating the processes for visual studio and restarting the IDE, however, because the "MyProject.exe" processes are still running. Building always fails with the error
"Error 1 error LNK1168: cannot open C:\Users\Brandon\Desktop\MyProject\Debug\MyProject.exe for writing"
Whenever I restart my computer, the lock files (as expected) are removed, and the "MyProject.exe" processes disappear. I can restart VS and everything works, but if I try to Debug (pressing "Start Debugging" or F5) the same issue occurs.
A process of my program is started ("MyProject.exe"), but the CLI window where my program's text should appear doesn't show up. Visual studio locks up, and "MyProject.exe" persists until the next restart because "MyProcess.exe" cannot be terminated.
My solution configuration is set to "Debug", Solution Platforms = Win32.
I have tried creating a new blank console project in VS 2013 and I get the same result: code builds fine, but I have the same debugging issue. I get an identical result with a quickly assembled "Hello World" project.
Sorry for being a noob, but honestly. I really don't know what's going on, so any help is greatly appreciated.
(Note: Running Windows 10 with VS2013)
EDIT (UPDATE):
So, I'm having the same problem with several programs in Windows 10 (most notably Allegorithmic's Substance Painter). So it looks like this may actually be an OS problem. Several of my programs whenever I try to launch them do the same thing...the program acts like it's going to launch, but then no usable window appears. Looking at my processes I can see that the process has been started, but it is once again unkillable. For reference, I am using Windows 10 Version 1511 (OS Build 10586.17).
I believe your problem might be Avast, if you are running it. I had exactly the same issues until I uninstalled it. Had upgraded to Win10 and VS2013 just froze, same as you described.
Cheers.
I have a complex C# project that I ported over from C++ and now I'm in the middle of debugging. Things are working great most of the time but more often than not I have huge problems with Visual Studio and debugger attached to WP7 emulator. For some strange reasons, my debug session is often abruptly terminated while stepping through the code without any indication from VS or any trace left in the Output window.
There are even some cases when a breakpoint is hit and then when I hover over a particular variable, VS simply exits the current debugging session. If I refrain from inspecting the variable contents, nothing happens and VS waits happily forever.
As the app is a memory hog by definition, I am wondering whether I am hitting any debugger / WP7 / emulator limits of any kind. Why would a mouse over variable terminate debugging session? Most of all, why is there no trace of what happened? I am left to wonder whether this is a VS issue or an emulator issue or even an app issue.
What are your computer specs?
I have seen similar problems on computers with low specs, especially computers with low memory.
Try clearing out memory hogs from your PC (CCleaner is a good tool) and running Visual Studio in administrator mode.
I have found this post which has helped me immensely. It appears that having ToString() overrides can sometimes crash the debugging session. I have implemented mine for the sole purpose of having customized value representation of variables/values in the debugger.
After removing all the ToString() overrides I am able to debug normally again. The thing that still puzzles me is the fact that no exceptions are leaked from my ToString() overrides so I wonder why debugger behaves the way it does but at least the problem is solved for now.
I hope this helps someone.
I have noticed that about every third time or so I start up the VB6 IDE, a message box appears with the following error message:-
Method '~' of object '~' failed
This doesn't happen for any particular project or with any other thing in common that I have noticed. It doesn't appear to cause any problems after dismissing the message. My question is: ought I to worry about this, and if so, what should I do about it.
I have noted these other questions about the same error message here, here and here, but I get the message on opening up the project.
This is usually caused by locked clipboard on local machine. VB6 IDE add-ins use clipboard to copy/paste icons to toolbar buttons because the add-in API does not expose any other way of putting an image there.
Usually Remote Desktop client (mstsc.exe) is the culprit of the locked clipboard. The way Microsoft implemented transfer to remote clipboard is by probing local clipboard for available formats which locks it for a while. Clipboard is awfully designed global resource that can be accessed by a single process at a time and OpenClipboard API fails in flames for other processes if the resource is not currently available.
I used to occasionally run into this error and, in my case, it was caused by the Visual Source Safe add-in (bad install I guess; re-install corrected the issue). It never caused a problem; it was just a bother. As Jon stated in the comments, I would try shutting off add-ins to see if that fixes the issue. Another thing is to make sure you are running Service Pack 6.
I don't know about this specific error, but I do have some background information about this error message.
COM defines two levels of error information. All COM methods and properties have a return value with the type HRESULT, where 0 (S_OK) indicates success and negative values indicate an error. In addition there is a mechanism to provide so called "rich error information".
If a COM object generates rich error information, VB6 will show the information provided. If a COM object returns a negative value, but does not provide rich error information, then VB6 shows the message “Method '~' of object '~' failed”.
There are some standard error codes like E_POINTER and E_NOTIMPL which are often returned by COM objects in C++. All of these result in the message “Method '~' of object '~' failed”.
If you are implementing a COM object in C++, my advice is to always generate rich error information. (In ATL you just have to call the Error function.)
I uninstalled Visual Studio 6.0 and then re-installed it. This cleared the “Method '~' of object '~' failed” error for me. My VB 6 now appears to be functioning properly. I believe that, in my case, it has to do with several of the COM objects not being registered properly. My new machine received a ghost image from my old box which had VS on it.
I started getting this error all of a sudden on both of my development machines (one 32-bit, the other 64-bit). In my searching for a solution, someone made a tangential reference to SourceSafe.
Ahh, then it occurred to me that I had been recently cleaning up a project (clearing out .bak files, etc.), and one of the files I cleaned-out was 'MSSCCPRJ.SCC' (seeing how SourceSafe was - for our group - a distant relic, I felt "safe" removing this file from the project folder).
Long story short: restoring the file 'MSSCCPRJ.SCC' to the project folder, resolved this error.
I just came across this error while running VB6 on Windows Server 2012 R2. The offending Add-In was Visual Component Manager 6.0. Once I disabled that, the IDE was able to open without the Method '~' of object '~' failed issue. I'm not sure if that points to an installation issue or just "ancient" software on a "modern" OS.
For anyone else trying to install VB6 on Windows 7, 8, 10, 2012, etc., here are some useful links:
http://www.fortypoundhead.com/newbrowseresults.asp?catid=34
http://it.toolbox.com/blogs/locutus/how-to-install-visual-studio-6-onto-windows-10-70155
I just had the same experience when starting VB6 on my Windows 7 Ultimate desktop PC via a shortcut to a VB6 project (which, of course, starts VB6.) The notification box was titled "Visual Component Manager" and the message was "Method '~' of object '~' failed". It occurred when first starting the VB6 IDE, before the project was visible in the IDE. I have been using this process with this same project for several years with no issues, but today that message box popped up and had to be acknowledged. The one thing that I did differently today, and I believe this caused my problem, was to start an Excel 2007 workbook first and then start the VB6 project about three seconds later. Both were loading at the same time and they were probably battling each other for something they both needed. Starting my VB6 project by itself never results in this. Looking at all these responses, the one common thread seems to be that VB6 is unable to access some resources when they are needed. None of the responses suggest it is a serious problem; in fact, it appears to be simply a minor 'hiccup' until such time as the resources are freed.
I found the ultimate solution!
To avoid the "Method '~' of object '~'" message and avoid any "Windows Installer" message from running at startup of the VB6 IDE:
via the VB6.exe properties (after right-clicking on the file in Windows Explorer), ensure that VB6.exe has compatibility set to "Run in Windows 8" mode.
Ensure that the VB6.exe shortcut is set to NOT run as an Administrator.
With these settings it is OK to load any of the Add-Ins (including Visual Component Manager 6!)
It took me ages to work this out, but now VB6 loads with lightning speed and no annoying error messages.
I have a strange issue with VS2010 in which the grid-views within the IDE sometimes mis-behave, they go into a state of constant re-painting very very slowly, which then causes the all other windows in the OS to re-paint, this gets stuck in an endless loop and causes the OS UI to pretty-much lockup, the only way to fix is to close VS2010 or minimize it.
Here is a detailed explaination (this just mentions Team Explorer but I've had the issue with a connection string dialog too):
http://social.msdn.microsoft.com/Forums/en/tfsworkitemtracking/thread/57ceb594-10ac-482c-bb3d-9a294a538d6c
My gut feeling is that maybe there's an issue just on my laptop (maybe graphics card issue?) that only affects VS2010. It's SP1 by the way.
Any ideas?
UPDATE: I just tried to do some diagnosis when this issue occurs, so I opened up task manager, and that actually sorted the issue out, even after I've closed task manager, the re-painting stopped and everything worked as normal.
I haven't found the solution to this, but Ctrl+Alt+Delete, then clicking Cancel seems to cause VS2010 to 'snap out of it'.