VB icon

Method "~" of object "~" failed.

Email
Submitted on: 12/22/2017 9:38:20 AM
By: Nicholas Forystek  
Level: Advanced
User Rating: Unrated
Compatibility: VB 6.0
Views: 2515
author picture
 
     This is a piece of code I use to reveal hiding error trapping that goes on ignored, erratic, and misinforming. This code is important to my development; I encounter three separate different occasions using the Visual Basic development and external calls where error issues seen are displaying either the limited ability of the environment performing, or maybe something such as those of malicious or malpractice that become unchanged to error handling abilities. Unless able to deal with them from something like this post which is my workaround. I’ve noticed this sort of situation heavily in Add-In development when executing methods of the IDE, as well as event calls when you’re using AddressOf operator, and even sub-classing procedures if your perspective is from with in the executed method. This piece of template code for the calls one may in any external situation have, for myself, has delivered restoration of error trap handling to such errors like ‘Method “~” of object “~” Failed’ from complete shut down immediately to viewable, to standard error trap dialog with a “Debug” and “End” button.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Method "~" of object "~" failed.
' Description:This is a piece of code I use to reveal hiding error trapping that goes on ignored, erratic, and misinforming. This code is important to my development; I encounter three separate different occasions using the Visual Basic development and external calls where error issues seen are displaying either the limited ability of the environment performing, or maybe something such as those of malicious or malpractice that become unchanged to error handling abilities. Unless able to deal with them from something like this post which is my workaround. I’ve noticed this sort of situation heavily in Add-In development when executing methods of the IDE, as well as event calls when you’re using AddressOf operator, and even sub-classing procedures if your perspective is from with in the executed method. This piece of template code for the calls one may in any external situation have, for myself, has delivered restoration of error trap handling to such errors like ‘Method “~” of object “~” Failed’ from complete shut down immediately to viewable, to standard error trap dialog with a “Debug” and “End” button.
' By: Nicholas Forystek
'**************************************

Private Sub RealignExternalErrorTrapHandler()
 On Error GoTo handlemore:
 On Local Error GoTo handlemore:
 GoTo handleless:
handlemore:
 On Error Resume Next
 On Local Error Resume Next
 Err.Raise Err.Number, Err.Source, Err.Description
 On Error GoTo 0 'you may need these -1 initially
 On Local Error GoTo 0 'if they're deeply wrapped
handleless:
 SubcallVolitileExternalProcedure
End Sub
Private Sub SubcallVolitileExternalProcedure()
 On Error Resume Next
 On Error GoTo errhandle:
 On Local Error Resume Next
 On Local Error GoTo errhandle:
 VolitileExternalProcedure
 'and/or
 RaiseEvent VolitileExternalProcedure
 'and/or
 RtlMoveMemory ByVal VolitileExternalProcedure.Pointer, VolitileExternalProcedure.Address, 4
 
 Exit Sub
 On Error GoTo 0 'stay 0's
 On Local Error GoTo 0
errhandle:
 Err.Raise Err.Number, Err.Source, Err.Description
 Resume
End Sub


Other 18 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/13/2018 9:48:10 PM

‘Method “~” of object “~” Failed’ is an annoying type of error. I am interested in your code if it can help recover from it.
Can you give an example of using the code?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.