|
Hi!
below is the code
-----
Private Sub ThreadExceptionHandler(ByVal sender As Object, ByVal t As System.Threading.ThreadExceptionEventArgs)
' This is our default, catch all exception handler
' get the stacktrace object for this exception
Dim stack As New System.Diagnostics.StackTrace(t.Exception)
Dim i As Integer
Dim files As New Hashtable
Dim file As DictionaryEntry
Dim errFrm As ErrorForm
Dim fileStr As String
If Not Me.Disposing Then
' create a hashtable of files and versions involved
For i = 0 To stack.FrameCount - 1
If Not files.ContainsKey(stack.GetFrame(i).GetMethod.DeclaringType.Assembly.Location) Then
files.Add(stack.GetFrame(i).GetMethod.DeclaringType.Assembly.Location, _
stack.GetFrame(i).GetMethod.DeclaringType.Assembly.GetName.Version.ToString)
End If
Next
For Each file In files
fileStr += file.Key & " - " & file.Value & vbCrLf
Next
errFrm = New ErrorForm
If Not t Is Nothing Then
errFrm.messageLbl.Text = t.Exception.Message
errFrm.stacktraceTxt.Text = t.Exception.ToString & vbCrLf
Else
errFrm.messageLbl.Text = "Invalid exception trapped by default handler"
errFrm.stacktraceTxt.Text = "Not available"
End If
If Not Me.IsDisposed Then
'Mailer.Send(t.Exception.ToString & vbCrLf & fileStr, "Computer name: " & System.Environment.MachineName & _
' vbCrLf & "User name: " & System.Environment.UserName & vbCrLf)
LogError(Strings.Left(t.Exception.ToString & vbCrLf & fileStr, 7000))
errFrm.filesTxt.Text = fileStr
errFrm.ShowDialog(Me)
errFrm.Dispose()
End If
stack = Nothing
End If
End Sub
-----
since this code lies in appcontainer.dll but i can only run the project from screens.dll I am not sure how could i trace the error or do console.writeline from screen
please help
|
|
|
|
|
Hi,
thanks, but I asked for the ErrorForm constructor code...
uglyeyes wrote: since this code lies in appcontainer.dll but i can only run the project from screens.dll I am not sure how could i trace the error or do console.writeline from screen
?? not sure what you are saying here ??
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I forgot to mention this. each time i hit the title to go to title detail screen. in console it throws this msg
The thread '<no name="">' (0x2378) has exited with code 0 (0x0) and it keeps building up for each event (i.e clicking the title to get to title detail screen) and at the end it crash. so below is the output of the debug msg.
The application crashed when i try to see the title detail in 16th time
The thread '<no name="">' (0x2378) has exited with code 0 (0x0).
The thread '<no name="">' (0x26e8) has exited with code 0 (0x0).
The thread '<no name="">' (0x22fc) has exited with code 0 (0x0).
The thread '<no name="">' (0x25b4) has exited with code 0 (0x0).
The thread '<no name="">' (0x1fd4) has exited with code 0 (0x0).
The thread '<no name="">' (0x1dc4) has exited with code 0 (0x0).
The thread '<no name="">' (0x21d0) has exited with code 0 (0x0).
The thread '<no name="">' (0x1a8c) has exited with code 0 (0x0).
The thread '<no name="">' (0x11c0) has exited with code 0 (0x0).
The thread '<no name="">' (0x2234) has exited with code 0 (0x0).
The thread '<no name="">' (0x24cc) has exited with code 0 (0x0).
The thread '<no name="">' (0x269c) has exited with code 0 (0x0).
The thread '<no name="">' (0x2394) has exited with code 0 (0x0).
The thread '<no name="">' (0x1814) has exited with code 0 (0x0).
The thread '<no name="">' (0x18b4) has exited with code 0 (0x0).
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in HCA.SalesRep.AppContainer.exe
Additional information: Error creating window handle.
The program '[9756] HCA.SalesRep.AppContainer.exe' has exited with code 0 (0x0).
|
|
|
|
|
Not sure what you mean by errorform constructor code. i believe this..
Public Class ErrorForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
mLoadTime = Date.Now
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
.....
|
|
|
|
|
OK,
I think the problem you are having is caused by doing the ErrorForm stuff on a thread
that is not the main thread. When you do that on .NET 1.1 the app may hang, or the GUI
may fail to behave normally at any time; when you do that on .NET >= 2.0 you will get
an InvalidOperationException mentioning a "cross-thread-violation".
What you need to do is make sure the GUI-related code (that includes everything concerning
ErrorForm) to execute on the GUI thread; that is exactly the purpose of the
Control.InvokeRequired property and the Control.Invoke() method. I also would consider
creating the ErrorForm only once at app initialization, and populating and showing then
hiding it when appropriate (through Invoke).
As I said before, a more recent .NET version helps you in recognizing this kind of
faulty situation long before it causes trouble.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
do you think is that why the memory is not freeing up? do you think this is whats causing the whole thing? each time i go from title to title detail it increases the memory by around 5mb and even when i go back it doesn't free the memory up.
|
|
|
|
|
I don't know about your memory situation; I do know any app that violates the "every control
should only be accessed by the thread that created it" rule will behave badly, it may
freeze the GUI, hang completely, or (for a while) seem to function normally; whatever the
symptoms, it can not be trusted.
If you violate the rule, first thing to do is fix it. Everything else that remains has
to be handled thereafter.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hiii
need to know how can i disable some combination of keys using vb2005
example ctrl+shift+y while my program is running
but there is a tool i used in my program use this shortcut(ctrl+shift+y) ?????????????
thank you
|
|
|
|
|
I'm not really sure about this but try looking in to using the event of KeyPress on you form.
in C# you'd get teh event with something like this.KeyPress+=new K...
|
|
|
|
|
thank you Mr Rocky71
I did but in vain , i do not know what is the problem
thank you
|
|
|
|
|
I want to learn how to make an application like Shaderman in which we have blocks representing code and which we link together with lines. How are these block build? How are the lines being drawn? Did they use graphics 2d in C# to make the blocks and lines? Where could I find information?
|
|
|
|
|
You can get the code here[^]. Enjoy.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You're removing all the fun now...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Have you taken a look at what it's written in? Python - I figured that was mockery enough right there.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
OK, we're all set for another batch of jokes on rabbits, knights who say nih,
shrubberies, Castle of Anthrax, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
"What is your favorite color?"
|
|
|
|
|
I'm not sure, but it aint ColorControlPaint.DarkDark(Color.White)
PS: trying to keep this a programmer's forum
-- modified at 10:21 Thursday 16th August, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
As long as it's not Spam. It can be "Ham, Jam and Spamalot."
And on that note, I say Aurevior for a week - I'll catch you all when I get back from France.
But remember:
Your father was a hamster and your mother smells of elderberries. Now go away before I taunt you some more.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi!
i am working in a project of Notepad In C# window Form.
i have an some problem:
1. when i set the property of RichtextBox ScrollBar to Forced Both then horizontal scroll bar is not visible, like in Microsoft Notepad Appear.
2 i have set the richtext box dock property to be Fill but when i write text in richtext box the text after the end of Richtextbox wdth appear in the next line, while i want to appear it one line until an enter is being press, also horizontal scroll bar not appear.
3. The staus bar panel is change the postion when i mazimize the windows, how it can be control.
help me!
sorry for bad english.
Regards
|
|
|
|
|
Hi
1+2. set RTB.WordWrap=false;
3. set status.Dock
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
3. not working, panel could not resize
|
|
|
|
|
Hi friends
I have requirement like this.
Let's assume if one form contains more than one data grid which is used to populate different data's.
To identify the grid contents we can use grid caption.
Instead of using the grid caption show the Images in top left corner of data grid.
If any one come across this requirement.
Let me know how you were succeed this requirement
charles
|
|
|
|
|
Hi friends
I have requirement like this.
Let's assume if one form contains more than one data grid which is used to populate different data's.
To identify the grid contents we can use grid caption.
Instead of using the grid caption show the Images in top left corner of data grid.
If any one come across this requirement.
Let me know how you were succeed this requirement
Thanks
Charles A
charles
|
|
|
|
|
I have a winApplication which has a form.
In that form I have a sql data adapter which contains 4 command for select,update,delete,insert.
When I execute insert command, with passing 9 parameters values, by use of executenonguery function I receive "procedure or function "procedure name" has too many argument specified" error massage at line of executing.
What should I do? I don't know what's happend there cause I check every parameters by breakpoint and saw that every parameters were passed!
|
|
|
|
|
You have asked this question already[^]
I have given you suggestions already, including to post the code so we can see it.
isiran wrote: What should I do? I don't know what's happend there cause I check every parameters by breakpoint and saw that every parameters were passed!
And I've told you already that it is obvious that every paramter is passed because the error message tells you that "too many" parameters have been passed. This suggests that you are passing more parameters than was expected.
You have to help us to help you. We can't guess what is in your code. You have to show us.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|