Video class

Jan 13 2006 5:22 AM
    Pls read the following sample code:

  openFileDialog1.ShowDialog();
   if (openFileDialog1.ShowDialog() == DialogResult.OK)
   {
       Video vid=new Video(openFileDialog1.FileName);
       vid.Owner=this.panel1;
       vid.Play();
   }

     and in the Video class constructor i  get th following error :

" LoaderLock was detected
Message: DLL 'C:\WINDOWS\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang."

    Pls help.