Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Workaround found (was: Re: Eclipse RCP application: USB print hang) Date: 7 Aug 2015 22:30:18 GMT Organization: Private site at Eddersheim, Germany Lines: 27 Distribution: de Message-ID: References: X-Trace: individual.net KLAITsYJxrdx4lnsKBSfzgpIMWWiK4x0AceMvFubXr7lBRlbO+ Cancel-Lock: sha1:OcoSSxQ0zLNuBv17bd8t2wbMtL8= Xref: csiph.com comp.lang.java.programmer:32277 In comp.lang.java.programmer, Volker Borchert wrote: > > Using SWT 3.7.x, PaperClips, JRE 1.8.x, Windows 7 in VirtualBox on Linux, > HP USP laser printer. > > Power on printer, wait until in powersave. > Start virtual Windows. > Start RCP application. > Try to let the application print something. > Printing hangs in native StartDocW GDI API function. > Printing works after opening the printer setup/properties dialog, > even if cancelled immediately. > Printing from e.g. WordPad instead, works. Colleague accidentally hit the "Properties" button in the printer selection dialog, and even though he cancelled that immediately, printing then worked. So I added half a line of code that eventually calls GetDeviceCaps, and this seems sufficient to kick the printer sufficiently awake. I don't think this is a solution, but as a workaround, it'll do. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert