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

前端 未结 8 1432
深忆病人
深忆病人 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: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.)

提交回复
热议问题