INF: Limitations Converting from DOS to QuickWin Applications

ID Number: Q79836

1.00

WINDOWS

Summary:

Microsoft QuickC for Windows (QC/Win) version 1.0 allows MS-DOS

applications to be quickly converted for use in the Windows graphical

environment. To do this, choose Project from the Options menu and

select "QuickWin EXE." The QuickWin libraries used at link time for

this option have routines that simulate stdin/stdout/stderr, which

allows standard MS-DOS library routines, such as printf and scanf, to

be functional in the Windows graphical environment. However, the

QuickWin libraries do not support all the functionality of the MS-DOS

library routines or the MS-DOS environment. The following are

examples:

1. There is no support for any of the console I/O functions, such as

getch(), cprintf(), kbhit(), and other functions prototyped in

conio.h.

2. Terminal control codes in printf statements are not interpreted in

"QuickWin EXE" applications as they are by ANSI.SYS when running in

MS-DOS.

3. As noted on pages 33 and 35 in the "Microsoft QuickC for Windows

Development Environment Guide" version 1.0 manual, the MS-DOS

program must be character-based. No graphic routine calls from

GRAPHICS.LIB or PGCHART.LIB are supported.

The above routines were not implemented in order to avoid implying

more functionality than in fact exists in the current version of the

QuickWin libraries. These features are under review and will be

considered for inclusion in a future release of the QuickWin

libraries.

More Information:

1. The console I/O functions are not supported in the QuickWin

libraries because Windows does not allow the use of

device-dependent functions (except through the DPMI, which is

beyond the scope of this article) in its device-independent

operating environment. Conio functions, such as getch() and

putch(), make an MS-DOS interrupt 21h call, which is a

device-dependent call. Programs that use getc() and putc() (stdio

functions) work because they operate on streams and not on the

console device.

2. When the sample code below is run in MS-DOS with ANSI.SYS

installed, the control codes within the string literal clear the

screen and change the screen color to magenta. However, when this

code is compiled and linked with the "QuickWin EXE" option in

QuickC for Windows, the string literal is printed in the

"stdin/stdout/stderr" window exactly as stated. The current

QuickWin libraries do not have an equivalent to ANSI.SYS.

Sample Code

-----------

/* Compile options needed:

choose Project from the Options menu, then select "QuickWin EXE."

*/

#include <stdio.h>

main()

{

printf( "\33[45m\33[2J" );

}

Additional reference words: QCWin qcw 1.00