View previous topic :: View next topic |
Author |
Message |
BILLDOWS
Joined: 22 Jul 2005 Posts: 86 Location: Swansea, UK
|
Posted: Tue Nov 29, 2016 12:50 pm Post subject: START_PROCESS / PPROCESS |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Nov 29, 2016 4:15 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
BILLDOWS
Joined: 22 Jul 2005 Posts: 86 Location: Swansea, UK
|
Posted: Tue Nov 29, 2016 5:04 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
BILLDOWS
Joined: 22 Jul 2005 Posts: 86 Location: Swansea, UK
|
Posted: Wed Dec 07, 2016 7:40 am Post subject: |
|
|
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 |
|
Back to top |
|
|
|