I'm trying to create a class to handle my downloading and one thing I'm running into is
Invoke or BeginInvoke cannot be called on a control until the window handle has been created
The code I'm trying to run is
public bool TransferProgress(TransferProgress progress)
{
if (!mainform.IsHandleCreated)
{
mainform.CreateControl();
}
mainform.amountdl.Invoke((MethodInvoker)(() => mainform.amountdl.Text = "Downloaded " + progress.ReceivedObjects + "/" + progress.TotalObjects));
if (progress.TotalObjects == progress.ReceivedObjects)
{
mainform.amountdl.Invoke((MethodInvoker)(() => mainform.amountdl.Text = "Configuring Files Please Wait."));
}
return true;
}
Up top I thought I was creating a window handle, but C# doesn't agree with me. Last, but not least.
DoxramosManager mainform = new DoxramosManager();
Is up top within my class. My class is not a Winforms form.