debugging error

E

Eps

A first chance exception of type
'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

A first chance exception of type 'System.InvalidOperationException'
occurred in System.Windows.Forms.dll

I am getting the above errors (repeating in pairs) when debugging using
vs c#2005 beta .net framework 2. It happens just as i try and add a
item to a listViewBox (the item is just a string).

I realise you would probably need to see code to understand the problem,
but has anybody got any idea why these errors are coming up ?, is it a
thread problem ?, i do have a timer object in my program.

Any help appreciated.
 
J

Jianwei Sun

I think you may invoke the function from a thread which is NOT the
thread to create the UI.

u probably need to check is InvokeRequired
if (InvokeRequired)
{
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top