What does “Method '~' of object '~'

2019-01-09 05:25发布

I'm trying to run a legacy VB6 application on my desktop (it doesn't have a user interface, being a command-line app), and when I do, I get a message box saying

Run-time error '4099':

Method '~' of object '~' failed

This means nothing to me; does anyone have an idea what is going wrong?

标签: com vb6
7条回答
乱世女痞
2楼-- · 2019-01-09 06:14

This message occurs when a Visual Basic 6 application makes a COM interface call which throws an exception (i.e. returns a failure HRESULT). In this case, VB6 jumps to an exception handler (as set by On Error). In the exception handler there is visible an object Err which contains details of the exception.

If the object implements ISupportErrorInfo, and it does actually support error info, and it did set error info, then Err.Description takes the string that is in the error info set by the object. Otherwise, Err.Description takes the string Method ~ of ~ failed.

IDK whether other versions of VB do the same thing; or if the message is also set in other scenarios besides the one I have just described.

查看更多
登录 后发表回答