你在新的线程中创建的activex?

解决方案 »

  1.   

    新学的C#,对什么线程不理解。 
    static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new StartForm());    
            }
    这是Main函数,在StartForm()中利用
     private void timer1_Tick(object sender, EventArgs e)
            {
                new System.Threading.Thread((System.Threading.ThreadStart)delegate
                {
                    Application.Run(new LogForm());
                }).Start();
                this.Close(); 
            }
    创建LogForm,在LogForm中利用
    private void button1_Click(object sender, EventArgs e)
            {
                if (String.IsNullOrEmpty(textBox1.Text.Trim()) || String.IsNullOrEmpty(textBox2.Text))
                {
                    MessageBox.Show("登录用户和登录密码不许为空!", "软件提示");
                }
                else
                {
                    if (textBox1.Text == "admin" && textBox2.Text == "admin")
                    {
                        new System.Threading.Thread((System.Threading.ThreadStart)delegate
                        {
                            Application.Run(new MainForm());
                        }).Start();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("登录用户或者登录密码错误!", "软件提示");
                    }
                }
    创建MainForm,最后在MainForm中ACTIVE控件报错
     private void InitializeComponent()
            {
                this.axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash();报错