运行时遇到了错误。此错误的地址为 0x58e39031,在线程 0xe60 上。错误代码为 0x80131623。此错误可能是 CLR 中的 bug,
或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。

 xp系统,点击确定打印后,直接关闭程序,并为抛出异常

 

 

try
            {
                PrintDialog pd = new PrintDialog();
                FlowDocument fl = null;           // pd.ShowDialog();
                if (pd.ShowDialog() == true)
                {
                    try
                    {
                        fl = (FlowDocument)(Application.LoadComponent(new Uri("/PrintTable1.xaml", UriKind.RelativeOrAbsolute)) as UserControl).Content;
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message); }
                    try
                    {
                        pd.PrintDocument(((IDocumentPaginatorSource)fl).DocumentPaginator, "Order Document");
                    }
                    catch(Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }

相关文章:

  • 2021-06-12
  • 2021-07-23
  • 2021-04-02
  • 2021-11-21
  • 2022-12-23
  • 2021-12-20
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2023-02-17
  • 2021-10-31
  • 2021-04-28
  • 2021-12-21
  • 2021-07-06
  • 2021-12-06
  • 2022-01-19
相关资源
相似解决方案