"Method '~' of object '~' failed" on starting VB6 IDE

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 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.


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.

Tags:

Vb6