Hi!
I am getting this error when I call the GdViewer.PrintShowPrinterSettingsDialog method.
See below:
An unexpected error has ocurred.
System.Threading.ThreadExceptionEventArgs
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at GdPicture12.Internal.Printing.GdPicturePrinting.ᜀ.gdpicture_ᜀ(IntPtr A_0, IntPtr A_1, String A_2, IntPtr A_3, IntPtr& A_4, Int32 A_5)
at GdPicture12.Internal.Printing.GdPicturePrinting.ᜀ.ᜀ(IntPtr A_0, String A_1)
at GdPicture12.Internal.Printing.GdPicturePrinting.gdpicture_ᜀ(IntPtr A_0)
at PdfViewerNS.PrintWindow.btnPropriedades_Click(Object sender, EventArgs e)
I have a GdViewer showing a PDF file that I want to print.
This error occurs only in some machines, mainly Windows 8 and Windows 10, but not all, and I don't know the reason.
My code is similar to example
This is the method to select the printer:
private void cbxPrinters_SelectedIndexChanged(object sender, EventArgs e)
{
bool ok = gdPicturePrinter.viewer.PrintSetActivePrinter(cbxPrinters.Text);
}
This is the method to show printer settings:
private void btnPropriedades_Click(object sender, EventArgs e)
{
var res = gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog(this.Handle);
if (res != GdPictureStatus.OK)
{
//MessageBox.Show(res.ToString());
}
}
Can someone help me?
GdViewer PrintShowPrinterSettingsDialog error
Re: GdViewer PrintShowPrinterSettingsDialog error
We haven't been able to reproduce this behavior as of now despite multiple tests.
Please open a ticket on the support platform so we can investigate this further.
Please open a ticket on the support platform so we can investigate this further.
Re: GdViewer PrintShowPrinterSettingsDialog error
Hi Cedric
I solved my problem changing the method call from gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog(this.Handle) to gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog()
I don't know why, but this worked for me.
Anyway, thanks!
I solved my problem changing the method call from gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog(this.Handle) to gdPicturePrinter.viewer.PrintShowPrinterSettingsDialog()
I don't know why, but this worked for me.
Anyway, thanks!
Who is online
Users browsing this forum: Majestic-12 [Bot] and 2 guests