PWStevens

Hello, I have the following code that I'm running without problems on 32 bit, it brings up the print dialog just fine, however on 64 bit it doesn't work, nothing displays; we had the same problem with the crystal viewer and they gave us a hot fix to fix the issue; do I need to write directly to the windows api or create my own print dialog to get around this Is this a known issue, I didn't find anything on it.

Using frm As New System.Windows.Forms.PrintDialog

frm.Document = mPrintDocument

If frm.ShowDialog(Me) = Windows.Forms.DialogResult.Cancel Then

Return

End If

mPrintDocument.Print()

End Using

Error handling was removed for clarity... thank you in advance.

Phil



Re: 64-Bit .NET Framework Development. PrintDialog Not displaying in 64 bit

Sriram Rajamanuri

Try setting  USEExDialog=True as follows- It should work.,,

According to MSDN PrintDialog wont work unless its set :

http://msdn2.microsoft.com/en-us/library/system.windows.forms.printdialog.useexdialog.aspx

 

Using frm As New System.Windows.Forms.PrintDialog

frm.Document = mPrintDocument

frm.UseEXDialog=True  ' TRY THIS

If frm.ShowDialog(Me) = Windows.Forms.DialogResult.Cancel Then

Return

End If

mPrintDocument.Print()

End Using

frm.UseEXDialog=True

 






Re: 64-Bit .NET Framework Development. PrintDialog Not displaying in 64 bit

PWStevens

Thank you fro the response, that code did not help; it does the same thing and does not show.



Re: 64-Bit .NET Framework Development. PrintDialog Not displaying in 64 bit

Sriram Rajamanuri

Whats your OS, hardware (AMD , Intel )., .Net framework running on your 64-bit machine(am assuming its 2.0)... Did you re-compile against x64 as target

I tried the same code on my x64 and I could reproduce your scenario and the fix worked, once set...






Re: 64-Bit .NET Framework Development. PrintDialog Not displaying in 64 bit

PWStevens

Thank you! You are correct, the problem this time was between the chair and the keyboard; I usually deploy with batch files and this time deployed to a new folder to test on our production server and copied the code from the debug folder instead of release; so I was using an old build... your questions prompted me to relize that. THANK YOU!

Phil





Re: 64-Bit .NET Framework Development. PrintDialog Not displaying in 64 bit

Stevefs

This article was extremely helpful. I have been pounding my head against the desk for the past 8 hours trying to figure out why I couldn't get the print dialog on the 64 bit machines and dialog would work fine on the 32 bit stations. I searched all over the web (being that I'm not a programmer), and couldn't find anything until now. Thank you.