在OpenFileDialog.showDialog()上发生FetalExecutionEngineError [英] FetalExecutionEngineError On OpenFileDialog.showDialog()

查看:80
本文介绍了在OpenFileDialog.showDialog()上发生FetalExecutionEngineError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有一个使用 .Net Frameword 4 并以任何CPU 模式构建的WPF应用程序.
我有一个通过Bellow代码备份和还原软件数据库的窗口:

Hi i have A WPF Application That use .Net Frameword 4 And Build in Any CPU Mode.
i have A Window To Backup And Restore Software Database by Bellow Code:

private void GetBackup(object sender, RoutedEventArgs e)
{
    System.Windows.Forms.SaveFileDialog SF = new System.Windows.Forms.SaveFileDialog();
    SF.Title = "Save Backup File";
    SF.Filter = "Standard Zip File (*.Zip) |*.zip";
    if (SF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        DBConnection.GetBackup(SF.FileName);
        MessageBox.Show("Backup Complete.", "Backup Manager", MessageBoxButton.OK, MessageBoxImage.Information);
    }
}

private void RestorBackup(object sender, RoutedEventArgs e)
{
    System.Windows.Forms.OpenFileDialog RF = new System.Windows.Forms.OpenFileDialog();
    RF.Title = "Restor Backup File";
    RF.Filter = "Standard Zip File (*.Zip) |*.zip";
    if (RF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        DBConnection.RetBackup(RF.FileName);
        MessageBox.Show("Restor Complete.", "Backup Manager", MessageBoxButton.OK, MessageBoxImage.Information);
    }
}



现在,当调用RF/SF.ShowDialog()行时,我得到FetalExecutionEngineError.
什么是问题?

注意:我使用Access 2010数据库( Microsoft.ACE.OLEDB.12.0 ).



Now I Get FetalExecutionEngineError When Call RF/SF.ShowDialog() Line.
What is Problem?

Note: i Use Access 2010 DataBase (Microsoft.ACE.OLEDB.12.0).

Help Me Please!

推荐答案

您正在WPF应用程序中使用Windows.Forms控件.除非您采取预防措施适当地托管控件,否则这两种技术不会相互兼容,也不会起作用.

请参见
You''re using a Windows.Forms control in a WPF app. The two technologies are not compatbile with each other and won''t work unless you take precautions to host the controls properly.

See this stuff[^].


即使您使用的对话框在某些情况下也可以在WPF下工作,但这不是您应该使用的对话框.

对于消息框,您需要使用System.Windows.MessageBox:
http://msdn.microsoft.com/en-us/library/system.windows. messagebox.aspx [ ^ ].

对于文件打开等常见对话框,Microsoft建议使用Microsoft.Win32对话框.

有关概述,请参见:
http://msdn.microsoft.com/en-us/library/aa969773.aspx [ ^ ].

—SA
Even though the dialogs you''ve uses might work under WPF in certain cases, this is not what you should use.

For a message box, you need to use System.Windows.MessageBox:
http://msdn.microsoft.com/en-us/library/system.windows.messagebox.aspx[^].

For common dialogs like file open, Microsoft recommends to use Microsoft.Win32 dialogs.

For overview, please see:
http://msdn.microsoft.com/en-us/library/aa969773.aspx[^].

—SA


哦,我的天哪..我只是进入看看,以耶和华的名义是胎儿被处决" ...现在我知道了...它与System.Abortion类有关...
Oh my godness ..I just enter to see what in the name of the Lord was "FetalExecution"...now I know...it''s related to the System.Abortion class...


这篇关于在OpenFileDialog.showDialog()上发生FetalExecutionEngineError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆