PrintDialog Not displaying in 64 bit
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.PrintDialogfrm.Document = mPrintDocument
If frm.ShowDialog(Me) = Windows.Forms.DialogResult.Cancel Then Return End IfmPrintDocument.Print()
End UsingError handling was removed for clarity... thank you in advance.
Phil
Answers
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...
All Replies
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 IfmPrintDocument.Print()
End Usingfrm.UseEXDialog=True
- Thank you fro the response, that code did not help; it does the same thing and does not show.
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...
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
- 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.
Hi,
Could you please tell me from where did you get Crystal Viewer hot fix
Thank you
- Thank you very much. That solved my problem.Also, for those who will not support 64bits application you can still change you project settings and set the CPU option to x86. I Tried it and it works fine.Regards!


