an error when my main application form wants to run

Joined
Oct 18, 2012
Messages
12
Programming Experience
5-10
I have an extremely issue with this error: "Exception has been thrown by the target of an invocation"
My application works well on Windows 7 64Bit and 32Bit, But when I run this on Windows XP SP1 I see this error.

Remain unsaid, I've downloaded .NET Framework 3.5 SP1 from Microsoft web site and I installed it on windows XP SP1. after installed i run my application, two form run well, but on Mainform i see this Error

1.png

anyone can help me.?

Thanks
 
The Details in that dialogue shows the stack trace of the exception, i.e. the series of methods that were called to get to the exception. The actual issue is in the creation of an icon. We don't know exactly where that comes from though, because we can't see the whole stack trace so we don't know where it originates in your code. Try copying the entire contents of that Details box and posting that. In fact, try reading it yourself first and see if you can see where the issue is once you know where it originates in your code and what series of methods is being called.
 
Dear jmcilhinney


thanks for your post
actually on the button event i wrote this Code:

Mailfrm.Show()
Me.Hide()

I checked Mainform_Load event, there are no errors with next form that will be run.

Codes On Mainform_Load():

CheckForIllegalCrossThreadCalls = False
My.Computer.Registry.CurrentUser.CreateSubKey("OnlineExaminationSystem")
Me.Text = Me.Text & " (" & My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\OEMS", "Registered Name", Nothing) & ")"
If Not Directory.Exists(App_Path() & "\Lessons") Then
Directory.CreateDirectory(App_Path() & "\Lessons")
End If
If Not Directory.Exists(App_Path() & "\Examed") Then
Directory.CreateDirectory(App_Path() & "\Examed")
End If
For i = 0 To 254
If OnlineUserss(i) <> "" Then
LV.Items.Add("User" & i, 0)
End If
Next i
 
If you can't follow simple instructions then you make it rather difficult to help you. I specifically said:
Try copying the entire contents of that Details box and posting that.
Did you decide to ignore that for a reason? If we have to keep repeating ourselves to get you to provide the required information then we're going to give up before too long and you miss out.

Apart from that, get rid of this line of code:
VB.NET:
CheckForIllegalCrossThreadCalls = False
and never use it again. It may or may not be related to your issue but you never need to do that anyway. If you need to update the UI from a secondary thread then there are proper ways to do that.
 
OK. I removed this line

CheckForIllegalCrossThreadCalls = False

In your opinion, Is it might be for Icons that I've used on the Windows Form? Such as all icons that I used to show in ListView or Form Icon

Thanks
 
OK. I removed this line

CheckForIllegalCrossThreadCalls = False

In your opinion, Is it might be for Icons that I've used on the Windows Form? Such as all icons that I used to show in ListView or Form Icon

Thanks

Who knows? Maybe I could answer that question if you provided the information that I have now asked for twice. If you want us to help you then please give us the information we ask for when we ask for it. If you don't then you're wasting our time. I won't be posting to this thread again until I see the information I asked for.
 
Back
Top