Win32 Console app -> Win32 app: help wanted
Author |
Message |
Reynold Zui #1 / 8
|
 Win32 Console app -> Win32 app: help wanted
Hello, I'm using Developer Studio for my fortran source. I have an application which is a Win32 console application. As a result, a Dos screen appear while running the program. In my source I use write and read statemens to write to this screen and read from it. I want to create a Win32 application which should result in getting rid of the Dos screen. However, what should I do with the write and read statements? I think I have to create a kind of dialog / form in which I have to put some text fields to read from and a box in which I can write. I have tried to add a dialog but it doesn't seem to work. Can anyone help me? Thanks, Reynold
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Tony Richards, Optical Systems Grou #2 / 8
|
 Win32 Console app -> Win32 app: help wanted
IMHO, if it aint broke, don't change it. If your application functions perfectly satisfactorily with a single text input/output window then why go to all the trouble to change it? However, a QuickWIn version which opens a child window for input/output (or, if you want, seperate child windows for input and output) can easliy be implemented by using the statement OPEN(unit=nn,FILE="USER",TITLE='whatever you want') and the window will be forever identified by the unit number nn, until you CLOSE it, so that you can set focus on it using SETFOCUSQQ(nn) whenever you want input. Dialogs are fine if you just want to push buttons, tick boxes, select from lists, enter text. If you want to enter numerical data, you have to remember that dialogs operate with CHARACTER strings (at least, my version of CVF does), so that it is quite possible accidentally to input invalid numerical data. In order to avoid or recover from such errors, you will still have to get at the numerical data using internal formatted reads (from character variables) and output numerical data (using internal WRITEs to character variables) in order to trap typos etc using the ERR=statementnumber facility in READ and WRITE. HTH.
Quote: > Hello, > I'm using Developer Studio for my Fortran source. I have an application > which is a Win32 console application. As a result, a Dos screen appear while > running the program. In my source I use write and read statemens to write to > this screen and read from it. > I want to create a Win32 application which should result in getting rid of > the Dos screen. However, what should I do with the write and read > statements? I think I have to create a kind of dialog / form in which I have > to put some text fields to read from and a box in which I can write. I have > tried to add a dialog but it doesn't seem to work. > Can anyone help me? > Thanks, > Reynold
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Reynold Zui #3 / 8
|
 Win32 Console app -> Win32 app: help wanted
Just to answer your question why I would change it: after let's say 20 write statements you can's see what was written in the first statements. It should be possible to check all the write statements at the end of the application run. I thought this should only be possible using a windows based screen. Does anyone have a better idea?
Quote: > IMHO, if it aint broke, don't change it. > If your application functions perfectly satisfactorily with a single text > input/output window > then why go to all the trouble to change it?
> > Hello, > > I'm using Developer Studio for my Fortran source. I have an application > > which is a Win32 console application. As a result, a Dos screen appear > while > > running the program. In my source I use write and read statemens to write > to > > this screen and read from it. > > I want to create a Win32 application which should result in getting rid of > > the Dos screen. However, what should I do with the write and read > > statements? I think I have to create a kind of dialog / form in which I > have > > to put some text fields to read from and a box in which I can write. I > have > > tried to add a dialog but it doesn't seem to work. > > Can anyone help me? > > Thanks, > > Reynold
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Steve Lione #4 / 8
|
 Win32 Console app -> Win32 app: help wanted
Quote: >Just to answer your question why I would change it: after let's say 20 write >statements you can's see what was written in the first statements. It should >be possible to check all the write statements at the end of the application >run. I thought this should only be possible using a windows based screen.
You can use a QuickWin project for this and not change a line of source.
Fortran Engineering Compaq Computer Corporation, Nashua NH Compaq Fortran web site: http://www.compaq.com/fortran Compaq Fortran Message Board: http://forum.compaq.com:80/mb8/system/fortran_login.html
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
James Van Buskir #5 / 8
|
 Win32 Console app -> Win32 app: help wanted
Quote:
>Just to answer your question why I would change it: after let's say 20 write >statements you can's see what was written in the first statements.
mode con: lines=50 Or just save the output to a file via Fortran statements or redirection.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Brian D. Ba #6 / 8
|
 Win32 Console app -> Win32 app: help wanted
Reynold, Well if you don't want to try the approach of making a QuickWin program and modifing it I think you will have to create a new project as a "Fortran Windows Application". There are a number of examples that come with DVF. I found it to be quite a lot of work to convert an old style fortran program to one that works well (looks good) in windows. For me the first big difference is that the original main program is now a subroutine of the windows interface code that DVF creates for you. Also you have to change your thinking a bit. Unlike console programs that run more or less one line after the next the windows code is, of course, event driven. So, for instance, instead of the program asking you for one input at a time you get a screen of input boxes which you fill out than hit a button called "Process", "Anyalize", or "Run". Good luck on your project. Brian
Quote: >Just to answer your question why I would change it: after let's say 20 write >statements you can's see what was written in the first statements. It should >be possible to check all the write statements at the end of the application >run. I thought this should only be possible using a windows based screen. >Does anyone have a better idea?
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Reynold Zui #7 / 8
|
 Win32 Console app -> Win32 app: help wanted
All, Thanks for the advise. I have tried it and it works fine in a QuickWin application. However, one more question: I use SETWSIZEQQ to resize a child to max size. I do this directly after a OPEN statement. Running the application, I see first a small child screen which directly will resize to max. Is it possible to show the child screen on max by default, such that I don't see it resize during the application run? Thanx, Reynold
Quote:
> >Just to answer your question why I would change it: after let's say 20 write > >statements you can's see what was written in the first statements. It should > >be possible to check all the write statements at the end of the application > >run. I thought this should only be possible using a windows based screen. > You can use a QuickWin project for this and not change a line of > source.
> Fortran Engineering > Compaq Computer Corporation, Nashua NH > Compaq Fortran web site: http://www.compaq.com/fortran > Compaq Fortran Message Board: > http://forum.compaq.com:80/mb8/system/fortran_login.html
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Steve Lione #8 / 8
|
 Win32 Console app -> Win32 app: help wanted
Quote: >I use SETWSIZEQQ to resize a child to max size. I do this directly after a >OPEN statement. Running the application, I see first a small child screen >which directly will resize to max. >Is it possible to show the child screen on max by default, such that I don't >see it resize during the application run?
You can call SETWSIZEQQ from an INITIALSETTINGS routine. Just be aware that it will return -1, suggesting failure, but that's only because it can't be sure that the requested size can be accomodated. (This may change in a future release.) So just ignore the return value.
Fortran Engineering Compaq Computer Corporation, Nashua NH Compaq Fortran web site: http://www.compaq.com/fortran Compaq Fortran Message Board: http://forum.compaq.com:80/mb8/system/fortran_login.html
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
|