Reputation: 812
I'm getting this error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
On these lines:
m_SplashForm.Invoke(
new SplashStatusChangedHandle(delegate(string str) { m_SplashInterface.SetStatusInfo(str); }),
new object[] { value }
);
I'm trying to use Application.Exit()
Can anyone help me?
Thanks in advance
Upvotes: 0
Views: 792
Reputation: 755397
The error message pretty much says it all here. Invoke and BeginInvoke cannot be used on a control until the underlying handle is created. This typically happens when the Form is initially displayed. Are you not displaying the form?
You can also force the issue by calling the CreateControl
method.
Upvotes: 1
Reputation: 2408
Hook to the Control.OnHandleCreated event then you will be permited to do Application.Exit().
Upvotes: 0