title: C++/CLI WinForms: BeginInvoke Error
body: <p>I am unable to figure out the reason for this error:</p>
  
  <blockquote>
    <p>Invoke or BeginInvoke cannot be called on a control until the window handle has been created.</p>
  </blockquote>
  
  <p><strong>Here is my (stripped) code:</strong></p>
  
  <pre><code>private: delegate void MyDelegate(Object^ openFileDialog1);
  ListView^ myDelegate;
  
  private: void import_links(Object^ openFileDialog1) {
              myDelegate = (gcnew System::Windows::Forms::ListView());
              myDelegate-&gt;BeginInvoke( gcnew MyDelegate( this, &amp;Form1::import_links ), openFileDialog1);
  
              //do some work here
  }
  private: System::Void Import_LinkClicked(System::Object^  sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^  e) {
          OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
  
          if ( openFileDialog1-&gt;ShowDialog() == System::Windows::Forms::DialogResult::OK )
          {
              Thread^ importThread = gcnew Thread(gcnew ParameterizedThreadStart(this,&amp;Form1::import_links));
              importThread-&gt;Start(openFileDialog1);
          }
      }
  </code></pre>
  
  <p>Please let me know the solution.</p>