Click here to Skip to main content
14,606,161 members
   

C#

 
JokeRe: Counting duplicate entries in an ArrayList Pin
Luc Pattyn26-Jul-08 13:18
sitebuilderLuc Pattyn26-Jul-08 13:18 
GeneralRe: Counting duplicate entries in an ArrayList Pin
Jacob Dixon26-Jul-08 13:29
MemberJacob Dixon26-Jul-08 13:29 
GeneralRe: Counting duplicate entries in an ArrayList Pin
PIEBALDconsult26-Jul-08 17:59
professionalPIEBALDconsult26-Jul-08 17:59 
GeneralRe: Counting duplicate entries in an ArrayList Pin
Luc Pattyn26-Jul-08 18:04
sitebuilderLuc Pattyn26-Jul-08 18:04 
GeneralRe: Counting duplicate entries in an ArrayList Pin
PIEBALDconsult26-Jul-08 18:16
professionalPIEBALDconsult26-Jul-08 18:16 
GeneralRe: Counting duplicate entries in an ArrayList Pin
Jacob Dixon27-Jul-08 6:40
MemberJacob Dixon27-Jul-08 6:40 
GeneralRe: Counting duplicate entries in an ArrayList Pin
PIEBALDconsult27-Jul-08 18:03
professionalPIEBALDconsult27-Jul-08 18:03 
QuestionBackgroundWorker completes immediately [modified] Pin
#realJSOP26-Jul-08 6:32
mva#realJSOP26-Jul-08 6:32 
I've got a BackgroundWorker that's supposed to perform processing on a 1gb file, but the worker is completing immediately before it even gets to the processing code in the DoWork event handler.

When I put a breakpoint on the first line in the event handler, it tells me this:

Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.<br />


What the hell does that mean?

I'm setting up the backgroundworker object like so:

encryptWorker = new BackgroundWorker();
encryptWorker.WorkerReportsProgress = true;
encryptWorker.WorkerSupportsCancellation = true;
encryptWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(encryptWorker_DoWork);
encryptWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(encryptWorker_RunWorkerCompleted);
encryptWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(encryptWorker_ProgressChanged);


I'm calling it like so. I've set a breakpoint on the last line in this block and have verified that the nextFile object is valid:

FileItem nextFile = m_filesToProcess[0];
this.m_fileBeingProcessed = nextFile;
while (this.encryptWorker.IsBusy)
{
	Thread.Sleep(500);
}
this.progressBar.Value = 0;
this.encryptWorker.RunWorkerAsync(nextFile);


The DoWork function looks like this:

private void encryptWorker_DoWork(object sender, DoWorkEventArgs e)
{
	BackgroundWorker thisWorker = sender as BackgroundWorker;

	FileItem fileItem = e.Argument as FileItem;

	// encryption starts here
	if (fileItem.Toggle == EncryptToggle.Encrypt)
	{
		switch (fileItem.EncryptType)
		{
			case "blah blah" : 
				{
					FileEncryptor encryptor = new FileEncryptor(thisWorker, fileItem);
					encryptor.EncryptFile();
				}
				break;
				}
			}
		}
	}
}


When I set a breakpoint on the first line of the function above, it takes a few seconds for the cursor to become available, and when I pressed F10 (or F11) to step over the line, none of the subsequent lines are executed, and the Completed event handler is called.

What have I done wrong?


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Saturday, July 26, 2008 1:26 PM

AnswerRe: BackgroundWorker completes immediately Pin
Mark Salsbery26-Jul-08 7:21
MemberMark Salsbery26-Jul-08 7:21 
GeneralRe: BackgroundWorker completes immediately Pin
#realJSOP26-Jul-08 7:27
mva#realJSOP26-Jul-08 7:27 
GeneralRe: BackgroundWorker completes immediately Pin
Mark Salsbery26-Jul-08 8:59
MemberMark Salsbery26-Jul-08 8:59 
GeneralRe: BackgroundWorker completes immediately Pin
#realJSOP26-Jul-08 10:26
mva#realJSOP26-Jul-08 10:26 
GeneralRe: BackgroundWorker completes immediately Pin
Mark Salsbery26-Jul-08 10:43
MemberMark Salsbery26-Jul-08 10:43 
QuestionRe: BackgroundWorker completes immediately Pin
Mark Salsbery26-Jul-08 10:47
MemberMark Salsbery26-Jul-08 10:47 
AnswerRe: BackgroundWorker completes immediately Pin
Luc Pattyn26-Jul-08 7:31
sitebuilderLuc Pattyn26-Jul-08 7:31 
AnswerRe: BackgroundWorker completes immediately Pin
Ed.Poore26-Jul-08 9:23
MemberEd.Poore26-Jul-08 9:23 
GeneralRe: BackgroundWorker completes immediately Pin
#realJSOP26-Jul-08 10:16
mva#realJSOP26-Jul-08 10:16 
AnswerRe: BackgroundWorker completes immediately [SOLVED] Pin
#realJSOP26-Jul-08 11:20
mva#realJSOP26-Jul-08 11:20 
GeneralRe: BackgroundWorker completes immediately [SOLVED] Pin
Ed.Poore26-Jul-08 11:21
MemberEd.Poore26-Jul-08 11:21 
QuestionBackColor Pin
Evan St. John26-Jul-08 5:50
MemberEvan St. John26-Jul-08 5:50 
AnswerRe: BackColor Pin
Evan St. John26-Jul-08 6:04
MemberEvan St. John26-Jul-08 6:04 
AnswerRe: BackColor Pin
PIEBALDconsult26-Jul-08 8:29
professionalPIEBALDconsult26-Jul-08 8:29 
GeneralRe: BackColor Pin
Evan St. John26-Jul-08 14:08
MemberEvan St. John26-Jul-08 14:08 
GeneralRe: BackColor Pin
PIEBALDconsult26-Jul-08 18:12
professionalPIEBALDconsult26-Jul-08 18:12 
GeneralRe: BackColor Pin
Evan St. John26-Jul-08 23:59
MemberEvan St. John26-Jul-08 23:59 

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.