Printing.rb run time error

I have attached a copy of printing.rb for reference.

When running this program which I got from the samples is that it gets
an
error under the following scenario.

1.0 Run the program.
2.0 Select the File/PageSet up menu
3.0 Hit ok on the page set up dialog.
4.0 Run your mouse over the window that exists after the dialog closes
5.0 The program dies.

a. My best guess is that the dc shown in MyCanvas class (line 196 in
the
attachment) has been somehow lost during the page set up dialog
processing.
I am such a Ruby newbie that I don’t know if this could be correct.

b. It appears that the on_draw(dc) at line 196 is called from Windows.
If
my hypothesis about the dc being lost is correct, how could I capture,
save,
and restore it. All my attempts have failed.

c. I am digging through the printing.rb sample and putting in comments
as I
understand it better. My plan is to send the commented version
somewhere
when I finish it so that it will be easier for other Ruby newbies to
understand.

  • Where would I send it when I finish adding comments?*