Re: Problem using wxHtmlEasyPrinting

David Connet <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On 5/15/2023 4:41 PM, Vadim Zeitlin wrote:
> On Mon, 15 May 2023 16:24:24 -0700 David Connet wrote:
>
> DC> I'm not sure how to break the sample... I just tried commenting out all
> DC> the wxPrintDialogData settors (in OnPrint), but that still worked. There
> DC> must be some subtlety to how I was creating mine...
>
>   Could you please show the code where you initialize it in your
> application?
https://github.com/dconnet/AgilityBook/blob/master/src/Win/Print.cpp
> DC> I'll create a bug, but I'm not sure how to create a test case for that.
> DC> (I mean I can point to my github repo, but that's definitely not a
> DC> simple program!) In the bug, I'll suggest adding a debug (assert?) for
> DC> when E_INVALIDARG  is returned so it can at least give the programmer a
> DC> clue.
>
>   Thanks, this might be a good idea, but it would still be better if the
> existing code continued to work.

I think I just found a work around for existing code... (I'll update the 
bug too)

In printdlg.cpp, line 892, I just added:
```
if (pd->lpPageRanges[0].nFromPage == 0 || pd->lpPageRanges[0].nToPage == 0)
{
     pd->lpPageRanges[0].nFromPage = pd->lpPageRanges[0].nToPage = 1;
}
```

and (after commenting out the changes I made in my code) the print 
dialog popped up.

Dave

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/dc42d8a4-66a9-9eae-42d5-947886efbbc4%40agilityrecordbook.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.