“Method '~' of object '~' failed” on starting VB6 IDE

前端 未结 8 1426
深忆病人
深忆病人 2021-01-11 11:32

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 \'~\         


        
相关标签:
8条回答
  • 2021-01-11 11:56

    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.

    0 讨论(0)
  • 2021-01-11 11:59

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

    0 讨论(0)
提交回复
热议问题