Program hangs when printing 
Author Message
 Program hangs when printing

Hi, does anybody know why this program hangs, for about 2 minutes, when
I'm trying to print a picture just after the first print job is done?

On my form I have a CommonDialog control, Command button and a
Picture box control.

Load a picture into the picture box, put the code into sub
Command1_Click(), run the program and press the command button.
The size of mine picture is only 19,8KB

Here is all the code:

' --------- Code Start --------------------------
Private Sub Command1_Click()

Err.Clear
On Error Resume Next

CommonDialog1.CancelError = True
CommonDialog1.Flags = cdlPDDisablePrintToFile

MsgBox "Second time you print, the program hangs after you have clicked
OK."

CommonDialog1.ShowPrinter

' Cancel pressed
If Err Then
  Exit Sub
' OK pressed, print picture
Else
  Printer.PaintPicture Picture1.Image, 50, 50
  DoEvents
  Printer.EndDoc
End If

End Sub
' ---------- Code end -------------------------

I have printed 30 pages now!
I hate to debug print code.

I'm using VB 4.0 and have a HP Deskjet 600 printer.

Thanks!

--
Bjoern Magnussen

Rock'n Roll!
http://www.*-*-*.com/ ~steinse/index.html



Wed, 05 Apr 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. prevent program from hanging while printing

2. VB Program hangs when I try to unprotect word document with password

3. null find hanging up program

4. VS Always Hangs When Program Started With Debugging

5. Problems using compiled version of StreamReader - program hangs

6. Program using ODBC hangs for awhile...

7. Program seems to hang up

8. ActiveX DLL and program hanging...

9. VB 5.0 program hangs after event handler

10. Program hang up

11. Program "Hanging"

12. VB 6.0 Winsock Programs Hang in Windows XP

 

 
Powered by phpBB® Forum Software