Silverfrost Forums

Welcome to our forums

START_PROCESS / PPROCESS

29 Nov 2016 11:50 #18500

I have a program P1 which puts up a large number of user action buttons to print out various reports. Each button actions an appropriate print program (chainprog) P2,P3 etc etc

  call yield_program_control@(y_temporarily)
  istart95 = START_PROCESS@(chainprog, ' ')
  call yield_program_control@(y_temporarily)

In the chainprog almost the first thing done is to open_printer:

         call yield_program_control@(y_temporarily)
         wwww=open_printer@(idprnt)
         call yield_program_control@(y_temporarily)

         print*, wwww

This has worked fine for dozens of printers - real and Microsoft XPS / and various PDF utilities for many years - until Microsoft Print to PDF arrived!!

What happens with this printer is that as soon as P2 is entered the expected printer dialogue box is displayed and you then press print then the P2 process immediately becomes a background task and thus P1 just hangs. The print*, www in the above code is not actioned in this scenario.

HOWEVER if you wait 5 seconds with the Printer Dialogue box displayed and then press Print all works fine!

I can obviously use START_PPROCESS or START_PROCESS_AND_WAIT@ (both of which work in the normal manner one would expect) but then I will have to incorporate either messaging or file creation/deletion in over 20 programs to ensure P2 etc etc has finished before other printouts are selected.

Not really possible to turn this into a trivial example I'm afraid but any ideas would be most gratefully received.

Thanks

Bill

29 Nov 2016 3:15 #18502

Bill

I would try commenting out some or perhaps all of the calls to yield_program_control@. They may not be helping in this context.

29 Nov 2016 4:04 #18503

Thanks Paul - Initial attempt doing this gave no change - will continue trying but unless others have ideas I think it will eventually be up to START_PPROCESS and messaging / files. Really cannot understand why given the print dialogue comes up quickly as expected and accepts the Print action why the program seems to get lost. (if you select (immediately) NOT to print at this dialogue normal actions resume immediately).

Also, even if you pre-define the printer and use open_printer1 (for the MS PDF printer - and only with this printer) then the same problem occurs.

Many Thanks again

Bill

7 Dec 2016 6:40 #18517

A Google search reveals that others have experienced this problem on this particular printer (MS Print to PDF). The solution from a Silverfrost perspective is to use START_PROCESS_AND_WAIT@ which does allow this 'printer' - this inserts additional yield_process calls whilst the called process is executing.

Thanks to all who looked at this post

Bill

Please login to reply.