COMException was unhandled
<p>I am using <code>c#</code> to build a small test project which will scan a image .Here is my code to do that</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using WIA;
namespace Scanner
{
    public class Scanner
    {
        Device oDevice;
        Item oItem;
        CommonDialogClass dlg;
        public Scanner()
        {

                dlg = new CommonDialogClass();
                oDevice = dlg.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);


        }
        public void Scann()
        {
            dlg.ShowAcquisitionWizard(oDevice);
        }
        /// &lt;summary&gt;
        /// The main entry point for the application.
        /// &lt;/summary&gt;
       // [STAThread]
        static void Main()
        {
           Application.EnableVisualStyles();
           Application.SetCompatibleTextRenderingDefault(false);
           Application.Run(new Form1());
       }
    }
}

 private void button1_Click(object sender, EventArgs e)
        {
            Scanner oScanner = new Scanner();
            oScanner.Scann();
            button1.Text = "Image scanned";
            OpenFileDialog dlg = new OpenFileDialog();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                pictureBox1.Image = Image.FromFile(dlg.FileName);
            }
        }
</code></pre>

<p>But when I try to run the application and click the button I get the following error at this line  <code>dlg = new CommonDialogClass();</code></p>

<pre><code>Creating an instance of the COM component with CLSID {850D1D11-70F3-4BE5-9A11-77AA6B2BB201} from the IClassFactory failed due to the following error: 80070422.
</code></pre>

<p>Can anybody suggest me what the issue here is
Thanks</p>
