I’m using a BackgroundWorker to trigger a thread, in turn calling a function, which in turn calls Backgroundworker_ProgressChange via .ReportProgress();
Within ProgressChange, I am attempting to write entries to a log file from with some information received via the passed object.
Can I assume that ProgressChange actually holds the BackgroundWorker thread? Or will I miss some data in my log?
Specifically, I have ProgressChange adding items to a listbox. Conditionally, if the listbox.items.count > 15, I would like to enumerate the listbox.items and write them to a log file.
I’m flexible with a solution. It is not mandatory that the listbox not “miss” entries.
Thanks,
Matt
Afaik the ProgressChanged actions are Posted, so DoWork does not have to wait. But how would that matter to you writing activities?
The Progress updates will come in sequence, they won’t (can’t) interrupt each other. Just be careful not to make them too slow.