Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: Learning Datasets... PinPopular
PIEBALDconsult15-Aug-10 11:04
mvePIEBALDconsult15-Aug-10 11:04 
GeneralRe: Learning Datasets... Pin
Dan Mos15-Aug-10 12:06
Dan Mos15-Aug-10 12:06 
QuestionRe: Learning Datasets... Pin
JollyMansArt15-Aug-10 15:14
JollyMansArt15-Aug-10 15:14 
AnswerRe: Learning Datasets... Pin
Luc Pattyn15-Aug-10 15:54
sitebuilderLuc Pattyn15-Aug-10 15:54 
GeneralRe: Learning Datasets... Pin
Keith Barrow15-Aug-10 12:20
professionalKeith Barrow15-Aug-10 12:20 
GeneralRe: Learning Datasets... Pin
Mycroft Holmes15-Aug-10 14:34
professionalMycroft Holmes15-Aug-10 14:34 
GeneralRe: Learning Datasets... Pin
PIEBALDconsult15-Aug-10 16:58
mvePIEBALDconsult15-Aug-10 16:58 
QuestionTargetInvocationException? Pin
Megidolaon15-Aug-10 8:13
Megidolaon15-Aug-10 8:13 
So, it's been a while since I did any threading and so I thought to review some BackgroundWorkers.
I made a test program and get this exception I cannot explain.

It occurs during the ProgressChanged event when reading a double value.
I'm using an ArrayList as argument where the first value is a double (for accurate progress report) and the second value is a string array.
The exception gets thrown when trying to assign the value of the ArrayList to a local double variable.

Can anyone tell me what went wrong and how I can fix it?
private void BW_Text_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            ArrayList arg = (ArrayList)e.UserState;
            double progress = (double)arg[0]; //exception gets thrown here
            string[] content = (string[])arg[1];

            textprogress += progress;
            TSL_Text.Text = "Status: Reading..." + String.Format("{0:0.##}", textprogress) + "%";

            Fill_ListView(true, content);
        }
Thanks!
AnswerRe: TargetInvocationException? Pin
OriginalGriff15-Aug-10 8:26
mveOriginalGriff15-Aug-10 8:26 
GeneralRe: TargetInvocationException? Pin
Megidolaon16-Aug-10 3:29
Megidolaon16-Aug-10 3:29 
GeneralRe: TargetInvocationException? Pin
Alan N16-Aug-10 6:14
Alan N16-Aug-10 6:14 
GeneralRe: TargetInvocationException? [modified] Pin
Megidolaon16-Aug-10 15:40
Megidolaon16-Aug-10 15:40 
AnswerRe: TargetInvocationException? Pin
PIEBALDconsult15-Aug-10 8:28
mvePIEBALDconsult15-Aug-10 8:28 
AnswerRe: TargetInvocationException? Pin
Luc Pattyn15-Aug-10 8:41
sitebuilderLuc Pattyn15-Aug-10 8:41 
Question[Solved] UdpClient callback question [modified] Pin
AtomTech15-Aug-10 4:59
AtomTech15-Aug-10 4:59 
AnswerRe: UdpClient callback question Pin
Gary R. Wheeler15-Aug-10 5:22
Gary R. Wheeler15-Aug-10 5:22 
AnswerRe: [Solved] UdpClient callback question Pin
Luc Pattyn15-Aug-10 7:08
sitebuilderLuc Pattyn15-Aug-10 7:08 
GeneralRe: [Solved] UdpClient callback question Pin
Dan Mos15-Aug-10 7:19
Dan Mos15-Aug-10 7:19 
GeneralRe: [Solved] UdpClient callback question Pin
Luc Pattyn15-Aug-10 7:40
sitebuilderLuc Pattyn15-Aug-10 7:40 
QuestionProcess and memory Pin
keloth8715-Aug-10 4:12
keloth8715-Aug-10 4:12 
AnswerRe: Process and memory Pin
Gary R. Wheeler15-Aug-10 5:29
Gary R. Wheeler15-Aug-10 5:29 
AnswerRe: Process and memory Pin
Luc Pattyn15-Aug-10 7:16
sitebuilderLuc Pattyn15-Aug-10 7:16 
QuestionReading data from HTTP Pin
Wamuti15-Aug-10 3:48
Wamuti15-Aug-10 3:48 
AnswerRe: Reading data from HTTP Pin
Nicholas Butler15-Aug-10 4:14
sitebuilderNicholas Butler15-Aug-10 4:14 
AnswerRe: Reading data from HTTP Pin
Not Active15-Aug-10 4:15
mentorNot Active15-Aug-10 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.