Error to close form
-
Quote:
Friend What could be happening, because when I say close a form with unload me, it is giving the following error: Unable to unload within this context
Show the code where this is happening.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Quote:
Friend What could be happening, because when I say close a form with unload me, it is giving the following error: Unable to unload within this context
-
Friends
Passing more information on the problem for better understanding. See the routine below it is very simple, however I'm getting intermittent error in my application. Searching the error I got the link below, but checking my process I did not find anything related to the item resize. If anyone has any other information that can help me in this matter thank you for the attention.
Private Sub cmdExit_Click()
On Error GoTo TryCathError
Unload Me
Exit Sub
TryCathError:
Dim s_dsMsg As String
s_dsMsg = "Error :{" & Err.Number & "}" _
& vbNewLine & Err.DescriptionMsgBox s_dsMsg, vbCritical, "Error"
End Sublink ===> msdn.microsoft.com/en-us/library/aa243662(v=vs.60).aspx
There is an Unload statement in the Resize event of a Data, Form, MDIForm, or PictureBox control.
Remove the Unload statement from the event. -
Friends
Passing more information on the problem for better understanding. See the routine below it is very simple, however I'm getting intermittent error in my application. Searching the error I got the link below, but checking my process I did not find anything related to the item resize. If anyone has any other information that can help me in this matter thank you for the attention.
Private Sub cmdExit_Click()
On Error GoTo TryCathError
Unload Me
Exit Sub
TryCathError:
Dim s_dsMsg As String
s_dsMsg = "Error :{" & Err.Number & "}" _
& vbNewLine & Err.DescriptionMsgBox s_dsMsg, vbCritical, "Error"
End Sublink ===> msdn.microsoft.com/en-us/library/aa243662(v=vs.60).aspx
There is an Unload statement in the Resize event of a Data, Form, MDIForm, or PictureBox control.
Remove the Unload statement from the event.You don't unload in VB.NET; ..and the suggestion from the other site to include an exit-sub is also nonsense. What language are you targetting? And why do you think you need to dispose something that is in use? Unloading "Me" while you are executing one of its members is like stealing a cup while somebody is drinking coffee.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
You don't unload in VB.NET; ..and the suggestion from the other site to include an exit-sub is also nonsense. What language are you targetting? And why do you think you need to dispose something that is in use? Unloading "Me" while you are executing one of its members is like stealing a cup while somebody is drinking coffee.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Quote:
Eddy Vluggen / Grupo I'm programming with vb 6, the error I passed is code 365 Unable to unload within this context
In which case you have wasted EVERYONE's time. VB6 is no longer supported. Download VB.net.
Never underestimate the power of human stupidity RAH
-
Quote:
Eddy Vluggen / Grupo I'm programming with vb 6, the error I passed is code 365 Unable to unload within this context
-
In which case you have wasted EVERYONE's time. VB6 is no longer supported. Download VB.net.
Never underestimate the power of human stupidity RAH
-