I'm getting a problem with a VS 2008 application when I use the WebBrowser control's .ShowPrintPreviewDialog method and either print or close the dialog box. I'm working on a 64-bit Windows 7 computer and using Visual Studio's default Debug option
settings. The problem happens both when running from the IDE in debug mode and after compiling in x86 mode as a stand-alone.
The control is central to as an otherwise effective report management system, so on btnPrint_Click I assign HTML code to .DocumentText and then call .ShowPrintPreviewDialog, which works fine, other than it does need 2 clicks so it seems both stages have to
happen as separate events?
Although when I go to print, the document prints okay, the print preview dialog form closes itself and whole program crashes with the above message. I've also tried separating those stages to avoid the 2-click issue, but I still get the crash.
If I turn Project>Properties>Debug>"Enable unmanaged code debugging" ON, I get this message instead "Unhandled exception at 0x752c77df (urlmon.dll) in PMPos.exe: 0xC0000005: Access violation reading location 0x00000001."
The control's other print dialog methods work fine. Is there a solution that I can rely on when distributing the application or am I best abondoning this particular
View Complete Post