replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Vista and Printing
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Vista and Printing

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Tue Jul 08, 2008 2:39 pm    Post subject: Vista and Printing Reply with quote

I am checking out Vista with programs which have worked fine for a couple of years and more on XP. Most things are fine but I wondered if others had come across the following. [I must admit at the outset that I do not have a very recent version of the compiler]:

If I have a program 'A' to output results which just uses open_printer@ and close_printer@ and does NOT itself have any screen / buttons of its own then all works fine.

However if I have a program 'B' which has its own screen and buttons - say Print and Continue - and has the printing routines as a subroutine within it (open_printer / close_printer etc), then whilst the printing itself works fine (to local or network printer), and subsequent actions by the user (e.g. selecting Continue after Print which then writes to file and closes the open window) are acted on correctly, the program itself fails to close completely and remains sitting in Process Manager. IF the PRINT button is NOT used before selecting Continue, everything closes as expected!???

Any suggestions on cause, or how the rogue window might be closed (other than manually!) would be appreciated.

Many Thanks

Bill
Back to top
View user's profile Send private message Visit poster's website
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Wed Jul 09, 2008 9:03 am    Post subject: Vista and Printing Reply with quote

I should add that in 'desperation', and assuming this was a problem with my old version of Fortran, I have downloaded the latest personal FTN95 to a new Vista machine and get the same problem with several (fairly large) programs.

Thanks, Bill Sad
Back to top
View user's profile Send private message Visit poster's website
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Wed Jul 09, 2008 1:51 pm    Post subject: Vista Printing/Process Problem Sample Code Reply with quote

Sample code for this problem below:
c
c TASK2.FOR - to test Process Closure on Exit after Printing
c In VISTA leaves process still running if print actioned
c first and Exit afterwards.
c FTN95 TASK2.FOR /LINK
c
winapp
OPTIONS(INTL)
OPTIONS(LOGL)
implicit none
INCLUDE <WINDOWS.INS>
c
external exit_func
external iprint

integer*4 ii

ii=winio@('%ww[no_border,maximise]&')
ii=winio@('%ff%nlPrint then Exit - Process is still there !&')
ii=winio@(' %^11bt[&Print]&','gprinter_open',iprint)
ii=winio@(' %`^11bt[&Exit?]',exit_func)

end
c
integer*4 function iprint()
implicit none
INCLUDE <WINDOWS.INS>
integer*4 poclose
call set_text_attribute@(1L,10.0,0.0,0.0)
call draw_characters@('printer text',100L,100L,rgb@(0L,0L,0L))
poclose = close_printer@(0)
iprint = 0L
end
c
c --------------------------------------
c Function for 'EXIT'
c
integer*4 function exit_func()
implicit none
INCLUDE <WINDOWS.INS>
c
open(12,file='testit')
write(12,99000)
99000 format('Exit Key Pressed')
close(12)
exit_func = 0L
end
c
Back to top
View user's profile Send private message Visit poster's website
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Sun Jul 20, 2008 3:19 pm    Post subject: Vista & Printing Reply with quote

I am still experiencing this problem with Vista.

However in looking back at the code posted above the iprint function was set = 0L at the end and not 1L as intended. Selecting Print first (which then returns to allow a further button selection to be made), and then Exit following this does, on Vista, leave the process still sitting in process manager.

Thanks, Bill
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Sun Jul 20, 2008 8:50 pm    Post subject: Reply with quote

Bill,

I suspect that many Fortran folk have not gone for Vista, as it appears to consume more resources than XP. Not only that, but some of the "look and feel" aspects of Vista appear to be rather difficult to emulate with Clearwin+

You may well be a pioneer, and I for one look forward to reading the details.

Eddie
Back to top
View user's profile Send private message
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Sun Jul 20, 2008 9:50 pm    Post subject: Vista & Printing Reply with quote

Aside from the above 'bug???' - feedback would be welcome please ...

I am pleased to say that I have moved some 50,000 lines of FTN95 (or really FTN77) / and lots of old Clearwin+ code smoothly (aside from some old weak programming from me) over to Vista very easily. I was (up until a month ago) rather -ve about Vista but on a fast (Dual) processor with lots of memory code runs very quickly. To fully emulate Vista 'style' may be difficult in Clearwin but using the Aero Vista basis makes a nice smooth transition between screens. I too would not have bothered to move towards Vista (why complicate what works well already!) but as I produce code for business who will, in a year or two, probably move that way, getting to grips with it early is desirable.
Back to top
View user's profile Send private message Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Sun Jul 20, 2008 11:50 pm    Post subject: Reply with quote

HI,

I've had a problem with printing, but not in Vista. As soon as I saw that you were calling set_text_attribute@, then I realised that could be your problem. It does not now seem to be documented in FTN95, and has been replaced by separate routines.

Try
select_font@, scale_font@, rotate_font@, italic_font@

where real*4 parameters are now real*8 and integer*2 now integer*4

Regards

Ian

Old definition was
SUBROUTINE SET_TEXT_ATTRIBUTE@(FONT,SIZE,ROTATION,ITALIC)
INTEGER*2 FONT
REAL*4 SIZE,ITALIC,ROTATION
Back to top
View user's profile Send private message Send e-mail
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Mon Jul 21, 2008 7:32 am    Post subject: Vista & Printing Reply with quote

Dear Ian,

Many thanks for pointing this out - something to be noted - BUT unfortunately even if you either (a) cut out the statement completely and use defaults and/or (b) bring up the printer dialogue box and Cancel it without printing then in both instances when Exit is selected the process remains in Process Manager!

Thanks again

Bill
Back to top
View user's profile Send private message Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Mon Jul 21, 2008 7:49 am    Post subject: Reply with quote

Well, it was worth a try. I must say, I don't use gprinter_open@, rather I use open_printer@ or open_printer1@ your example would look like:

Code:

c
c TASK2.FOR - to test Process Closure on Exit after Printing
c In VISTA leaves process still running if print actioned
c first and Exit afterwards.
c FTN95 TASK2.FOR /LINK
c
winapp
OPTIONS(INTL)
OPTIONS(LOGL)
implicit none
INCLUDE <WINDOWS.INS>
c
external exit_func
external iprint

integer*4 ii

ii=winio@('%ww[no_border,maximise]&')
ii=winio@('%ff%nlPrint then Exit - Process is still there !&')
ii=winio@(' %^11bt[&Print]&',iprint)
ii=winio@(' %`^11bt[&Exit?]',exit_func)

end
c
integer*4 function iprint()
implicit none
INCLUDE <WINDOWS.INS>
integer*4 poclose,i
i=open_printer@(1)  !handle changed to 1 just for fun
if(i .eq. 1)then
  i=SELECT_GRAPHICS_OBJECT@(1)  !added just in case
  call set_text_attribute@(1L,10.0,0.0,0.0)
  call draw_characters@('printer text',100L,100L,rgb@(0L,0L,0L))
  poclose = close_printer@(1)
!force closure on return
  iprint = 0L
else
! remain open, as no printer selected
  iprint = 2L
endif

end
c
c --------------------------------------
c Function for 'EXIT'
c
integer*4 function exit_func()
implicit none
INCLUDE <WINDOWS.INS>
c
open(12,file='testit')
write(12,99000)
99000 format('Exit Key Pressed')
close(12)
exit_func = 0L
end
c


Regards

Ian
Back to top
View user's profile Send private message Send e-mail
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Mon Jul 21, 2008 9:44 am    Post subject: Vista & Printing Reply with quote

Dear Ian,

Thanks for your code example - exactly the same result I'm afraid. I just made one change to the code you posted -

When the Window with 'Print' and 'Exit' is put up I do NOT Exit until Exit is pressed (note comment in a previous post about fault in my original hastily posted code) - thus:

!DO NOT force closure on return after printing
iprint = 1L
else

Once again Print first followed by Exit closes window but leaves job in Process Manager.!!

I am currently resorting to using 'terminate process' to kill off the remains!!

Thanks again

Bill
Back to top
View user's profile Send private message Visit poster's website
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Mon Jul 28, 2008 3:11 pm    Post subject: Vista & Printing Reply with quote

The problem of a job which has produced printed output then remaining in process manager after closing all its windows still persists. However extensive tests have shown that it must be related to the way Vista deals with the closing of network shared printers - locally attached printers using the same drivers work fine and processes go as expected. Vista seems to need something more than close_printer@!!

I am currently using a call to killjob at the very end - which works - but would be grateful for assistance as to exactly how this should really be called.

subroutine killjob
include <windows.ins>
integer*4 L1
logical*4 L
L = terminateprocess(getcurrentprocess(),L1)
return
end

Hope this helps somebody (stupid enough to get involved with Vista at this point).

Many Thanks

Bill
Back to top
View user's profile Send private message Visit poster's website
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Tue Sep 30, 2008 2:23 pm    Post subject: Vista and Printing Reply with quote

This problem persists and Paul suggested that after a couple of months I might raise it again providing as simple a set of code as possible (below). Under Vista32 any program which puts up a window and then accesses and closes a network printer (or for example Acrobat) - whilst printing works fine - the .EXE remains active in Process Manager and does not close as expected. This problem does not occur when the printing program simply opens / closes the printer and does not put up a window of its own.

Many Thanks for any ideas...

Bill

winapp
INCLUDE <WINDOWS.INS>
c
external iprint
integer*4 iprint
integer*4 ii
c
ii=winio@('%ww[no_border]&')
ii=winio@('%ff%nlAfter Print - Process is still there !&')
ii=winio@('%^bt[&Print]',iprint)
end
c
integer*4 function iprint()
INCLUDE <WINDOWS.INS>
integer*4 poopen,poclose
poopen = open_printer@(2L)
call set_text_attribute@(1L,10.0,0.0,0.0)
call draw_characters@('printer text',100L,100L,rgb@(0L,0L,0L))
poclose = close_printer@(2L)
iprint = 0L
end
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu Oct 02, 2008 5:06 pm    Post subject: Reply with quote

I have had a look at this problem but I cannot throw any light on what is happening. The Vista that I have access to is on a virtual workstation and I am having problems connecting to a remote printer. As a result I have not been able to reproduce the problem.

Typically Vista causes problems because of increased security so if a program uses a resource for which it does not have full access rights then you can get unexpected errors.

If there is no visible error message then all that I can suggest is that you have a look at the System Event Viewer to see if any error events have been reported. This is not an easy task but here is an outline of what to do.

From the Start button, select Run and type in "mmc" for Microsoft Management Console.

In the [Cosole Root], click on File and then Add/Remove Snap-in.
Look for Event Viewer in the left hand pane and Add it to the selected snap-ins. Select the Local Computer for events to view.

Back in the Console Root, click on the Event Viewer (Local) node in the left hand pane and expand the Error tab in the right hand pane. Look for recent errors that relate to your application.

Its a long shot but it is all that I can think of.
Back to top
View user's profile Send private message AIM Address
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Mon Oct 06, 2008 11:26 am    Post subject: Vista and Printing Reply with quote

Dear Paul,

Many thanks for looking at this but without the appropriate IT resource I can see that you cannot duplicate things.

I have used MMC to view the Event / Error log but there are no relevant error entries there (as you say a long shot).

I would be VERY happy to perform any further tests you (or others) might suggest - I feel that there is no doubt that others will come across this software bug as Vista (rightly or wrongly) grows in popularity.

Just to mention that when you use the debugger on the code the program terminates normally but when you try to close the debugger the message 'task being debugged could not be shut down' is displayed.

Many thanks

Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group