======================================================================
  Microsoft(R) Product Support Services Application Note (Text File)
                 SQ0624: QuickC(R) Questions & Answers
======================================================================
                                                  Revision Date: 10/92
                                                      No Disk Included

The following information applies to Microsoft QuickC for MS-DOS(R),
Microsoft QuickC for Windows(TM). (See below for appropriate
versions.)

 --------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
| accuracy and the use of this Application Note. This Application    |
| Note may be copied and distributed subject to the following        |
| conditions: 1) All text must be copied without modification and    |
| all pages must be included; 2) If software is included, all files  |
| on the disk(s) must be copied without modification [the MS-DOS(R)  |
| utility DISKCOPY is appropriate for this purpose]; 3) All          |
| components of this Application Note must be distributed together;  |
| and 4) This Application Note may not be distributed for profit.    |
|                                                                    |
| Copyright 1992 Microsoft Corporation. All Rights Reserved.         |
| Microsoft, MS-DOS, and QuickC are registered trademarks and        |
| Windows is a trademark of Microsoft Corporation.                   |
| CompuServe is a registered trademark of CompuServe, Inc.           |
 --------------------------------------------------------------------

The information in this application note applies to version 1.0 of
Microsoft QuickC for Windows and version 2.51 of Microsoft QuickC for
MS-DOS.

 1. Q. I received an error message stating that the linker cannot find
       a library. What is causing this problem?
    
    A. Libraries are built to match the specific options you selected
       during Setup. You must match the options you selected during
       Setup by setting the same options throughout the environment.
       To do this in Microsoft QuickC for MS-DOS, choose Make from the
       Options menu, and choose the Compiler Flags button. Set the
       options to match those selected during Setup and choose the OK
       button. Then, choose the Linker Flags button, and again make
       sure the correct options are set. For Microsoft QuickC for
       Windows, choose Project from the Options menu, and choose the
       Compiler Options button. Set the options to match those
       selected during Setup. Then, choose the Linker Options button,
       and again make sure the correct options are set.
       
       For more information, please refer to Q28173 in the article
       library of the Languages FastTips system, or query on Q28173 in
       the Microsoft Knowledge Base on CompuServe(R).
       
 2. Q. I received the error message "Stack Plus Data Exceeds 64K."
    
    A. All segments have a limit of 64K. If the error is in the _TEXT
       segment, either eliminate unnecessary code or break the code
       into two separate modules, then go to the medium or large
       memory model and compile the code modules separately and link
       them together.
       
       If the error is in the _DATA segment, increase the memory model
       to compact or large. If you are working with the large memory
       model, use the /Gt3 compile switch. You can add this switch to
       the Global Custom Flags line in the Compiler Flags dialog box
       that is displayed when you choose Make from the Options menu.
       
 3. Q. I am having problems with samples shipped with the product.
       What could be causing these problems?
    
    A. If you are using the "C for Windows" manual that comes with
       Microsoft QuickC for Windows, the sample programs that should
       have been placed on disk were not. To obtain these files, you
       can either download them from the QuickC for Windows library in
       the Microsoft Languages Forum on CompuServe or you can call
       Microsoft Product Support Services at (206) 635-7010.
    
       If you are using Microsoft QuickC for MS-DOS, make sure that
       you do not load a C file without also loading the corresponding
       makefile. To run any sample program that is on disk, choose Set
       Program List from the Make menu, and open the .MAK file that
       corresponds to the sample you are using. Also make sure that
       your compiler options match the options you selected during
       Setup.
      
       For more information, please refer to Q80438 in the article
       library of the Languages FastTips system, or query on Q80438 in
       the Microsoft Knowledge Base on CompuServe.
    
 4. Q. What causes the error messages "Illegal pointer usage," "NULL
       pointer assignment," and "GP fault"?
    
    A. The "Illegal pointer usage" error message is generated only
       when the Pointer Check option is selected and you are writing
       outside the defined data segment or segments of your program.
       If you are writing to a specific memory address, deactivate the
       Pointer Check option to avoid this error.
       
       If you receive a run-time error stating that a NULL pointer
       assignment occurred, somewhere in your application you wrote to
       the NULL data segment. Microsoft QuickC for MS-DOS checks this
       segment when you exit your program. If changes have been made
       to this segment, the error message is displayed. This error
       usually occurs because you used a defined pointer before it had
       been initialized or you overwrote the data contained in that
       pointer.
      
       In Microsoft QuickC for Windows, a general protection (GP)
       fault occurs if you attempt to write outside a segment that you
       own. Windows-based applications are device independent and
       therefore cannot specifically write to a device. All
       communication with hardware devices must be done through a
       device driver and within device contexts.
       
 5. Q. What limitations do the Dialog Editor and the QuickCase:W tool
       have?

    A. You should be aware of the following limitations:
    
       a. You cannot use a symbol number for a dialog box; you must
          use the symbol name.
      
       b. Be sure to give the symbol name of the dialog box the same
          name as the base name of the dialog box file. (For example,
          MYDIALOG should be the symbol name for a dialog box in the
          MYDIALOG.DLG file.)
       
       c. Remember that QuickCase:W can generate code for only one
          dialog box per resource file, even though the Dialog Editor
          does not have that limitation.
       
 6. Q. What are the limitations of QuickWin applications?
    
    A. You should be aware of the following limitations:
    
       a. There is no support for any of the console I/O functions,
          such as GETCH, CPRINTF, KBHIT, and other functions
          prototyped in CONIO.H.
       
       b. Terminal control codes in PRINTF statements are not
          interpreted in QuickWin applications as they are by ANSI.SYS
          when you run an MS-DOS-based application under MS-DOS.
       
       c. As noted on pages 33 and 35 in the Microsoft QuickC for
          Windows '"Development Environment Guide" version 1.0, the
          MS-DOS-based program must be character based. No graphics
          routine calls from GRAPHICS.LIB or PGCHART.LIB are
          supported.
       
       For more information, please refer to Q79836 in the article
       library of the Languages FastTips system, or query on Q79836 in
       the Microsoft Knowledge Base on CompuServe.
       
 7. Q. I want to use the Microsoft Windows version 3.1 functions with
       Microsoft QuickC for Windows. Can I do this?
    
    A. Microsoft QuickC for Windows does not contain any Windows 3.1
       functionality because QuickC for Windows was released before
       Windows 3.1. To obtain Windows 3.1 functionality, you must use
       either Microsoft C/C++ Compiler version 7.0 or the Microsoft
       Windows 3.1 Software Development Kit (SDK). To use Microsoft
       QuickC for Windows with the Windows 3.1 SDK, simply point the
       Microsoft QuickC for Windows include and library paths to the
       SDK include and library paths by choosing Directories from the
       Options menu and typing the correct paths.
    
 8. Q. Can I build MS-DOS-based applications in Microsoft QuickC for
       Windows?
   
    A. Yes. However, Microsoft QuickC for Windows does not contain the
       library necessary to build graphics programs for MS-DOS. To do
       this, you must have an MS-DOS-based version of the QuickC or C
       compiler. If you have one of these, copy the GRAPHICS.LIB file,
       which is found in the LIB directory or on the Setup disks (use
       "SETUP/C" [without the quotation marks] to copy a single file),
       to the library directory of Microsoft QuickC for Windows, then
       add that file to the program list.
       
       For more information, please refer to Q84344 in the article
       library of the Languages FastTips system, or query on Q84344 in
       the Microsoft Knowledge Base on CompuServe.
       
        NOTE: The capability to debug MS-DOS-based applications is
        incorrectly documented on page 37 of the "Development
        Environment Guide." Version 1.0 of Microsoft QuickC for
        Windows does not have this capability.
      
 9. Q. What should I do if I receive a stack overflow error message?
    
    A. A stack overflow error indicates that you either have declared
       too much local data and the stack overflowed at run time, or
       you have a highly recursive program that requires more stack
       space.
    
       If you have declared too much local data, either dynamically
       allocate the space for your local variables, or use the STATIC
       keyword to force them out of the stack segment and into the
       data segment. If you need to increase the stack size, choose
       Make from the Options menu and select Linker Flags. In the
       Stack Size box, type the desired size.
       
10. Q. What should I do if I receive an error message indicating that
       I'm out of heap space?

    A. Because the Microsoft QuickC environment is always loaded in
       memory, an average of 300K of memory is available to the
       compiler and linker. Microsoft QuickC for MS-DOS cannot use
       extended memory; therefore, if an application becomes too large
       for the compiler to load itself into memory, a heap space error
       is generated. To correct this problem, either break up the
       source code into more modules, or compile and link using the
       command-line compiler and linker (QCL and LINK).

