Spire.PDFViewer is a powerful PDF Viewer component for .NET. It allows developers to load PDF document from stream, file and byte array.

Fri Nov 10, 2017 10:30 am

Hey,
Im trying to implement your PdfViewer into my semester project, it works fine when it comes to displaying the pdf's.
The problem occurs when I close the application, a System.ComponentModel.Win32Exception gets thrown with the message "Error creating window handle". If I remove the pdfviwer I have no problems closing the application.

LukeRH
 
Posts: 4
Joined: Wed Nov 08, 2017 11:19 pm

Mon Nov 13, 2017 2:29 am

Hello Luke,

Thanks for your post. I find that if using System.Environment.Exit(0) to close the application directly, there will be a Win32Exception. Please dispose the PdfDocumentViewer control before existing like below.
Code: Select all
        private void button1_Click(object sender, EventArgs e)
        {
            this.pdfDocumentViewer1.Dispose();
            System.Environment.Exit(0);
        }


Best reagrds,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Nov 14, 2017 8:03 am

Hello Luke,

Greetings from E-iceblue!
How is the issue going ? Did you try the solution I provided?
Your feedback will be greatly appreciated.

Sincerely,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Nov 28, 2017 9:09 am

Hey Simon,
Sry for the late return,
Disposing the viewer before using System.Environment.Exit(0) worked.
Thank you for your help.

LukeRH
 
Posts: 4
Joined: Wed Nov 08, 2017 11:19 pm

Tue Nov 28, 2017 9:54 am

Hello Luke,

Thanks for your feedback. Glad to hear that. If you encounter any other problem, welcome to get back to us.

Sincerely,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDFViewer