Newsgroups: comp.windows.ms.programmer
Path: utzoo!utgpu!watserv1!mims-iris.waterloo.edu!tom
From: tom@mims-iris.waterloo.edu (Tom Haapanen)
Subject: Frequently Asked Questions, comp.windows.ms.programmer edition
Message-ID: <1991Mar2.200040.5493@watserv1.waterloo.edu>
Summary: version 1.07 [last change: th/91-02-15 --- Compiler/RTF update]
Sender: daemon@watserv1.waterloo.edu
Reply-To: tom@mims-iris.waterloo.edu (Tom Haapanen)
Organization: WATMIMS Research Group, University of Waterloo
Date: Sat, 2 Mar 1991 20:00:40 GMT
Lines: 255


TABLE OF CONTENTS
(* changed items)

0.  Index

>>  1.  Windows newsgroups

    2.  Windows development tools *
    3.  Windows linkers 
    4.  Windows debuggers 
    5.  Windows RTF word processors  *

    6.  Windows extended memory handling
    7.  Windows screen prints

    8.  Device driver development 
    
    9.  Hiding dialog box controls
   10.  Adding controls to a non-dialog box window
   11.  Using floating-point in Windows
   12.  Changing button colors 
   13.  Programming using large model 

   *** A companion posting can be found in comp.windows.ms **

----------------------------------------------------------------------


1.  Why are there two newsgroups for windows?

>>  comp.windows.ms.programmer is for discussion about developing
    Windows software.  It is not intended for discussions about 
    Windows software or for questions about the Foobar SVGA drivers.
    comp.windows.ms is for any Windows discussions that do not concern
    development of Windows software.


    --------------------


2.  What tools can I use to develop software for Windows?

>>  There are a number of options, which are summarized below:

    1.	Use the Microsoft Windows SDK (Software Development Kit).  This is
    	a necessity for heavy-duty application development.  The SDK is
	designed for Microsoft C 5.1/6.0 and Microsoft Macro Assembler 5.1,
	but it is possible to use it with other compilers, such as Zortech
	C++ (but not including most Borland compilers).  If you plan to use
	a non-Microsoft compiler, call Microsoft Technical Support to
	obtain the free Supplemental Compiler Utilities disk.  The following
	compilers are currently known to work:
		- Borland C++		1.0	[*not* Turbo C++]
		- Glockenspiel C++	?.?
		- Microsoft C 		5.1+
		- Microsoft MASM 	5.0+
		- Microsoft Pascal	5.0
		- Microsoft QuickC	2.0
		- Stonybrook Modula-2	2.0+
		- Topspeed Modula-2	2.01+
		- Watcom C		8.0
		- Watcom C/386:Windows	8.0
		- Zortech C++		2.06+
	Of these, Borland C++ includes its own Windows libraries, and does
	not require you to purchase a Windows SDK (although you will need
	to buy the SDK documentation, which is available separately).

    2.	Use Actor.  Actor is an object-oriented programming environment,
    	with syntax resembling C.  It allows quick development of programs
	and/or prototypes, and compiles into an "image" file.  This must
	be distributed along with actor.exe; however, it is possible to
	combine these into a single .exe if you have the Whitewater
	Resource Toolkit.

    3.	Use Smalltalk/V, available for Windows in January/91.

    4.	Use ToolBook.  This is a HyperCard-like development environment
        for Windows -- the DayBook demo included with Windows 3.0 is a
	ToolBook application.  Development work is rapid, but at least
	the current versions run very sluggishly, even on 386/25s.  There
	is a conversion utility available to convert HyperCard stacks
	into ToolBook programs.
    
    5.	Use W:CASE or WindowsMAKER, both of which generate C code for 
	Windows.  This will still require the use of the SDK.  There is
	also available a shareware code generator UCB/WordPlan (available
	on cica.cica.indiana.edu), but it's considerably more limited in
	functionality than the commercial products.

    6.  Use EASEL/Windows.  This is an MIS-oriented package intended for
	development of client-server or cooperative processing applications.
	3270 connectivity, SQL, DDE, and Windows --- all for mere $7500.


4.  What linkers can be used for Windows programs?

>>  You can use link4, included on the Microsoft C 5.1/6.0 compiler disks,
    and available separately with the Supplemental Compiler Utilities
    diskette (free) from Microsoft.  Other linkers that work for Windows
    development are Optilink/Windows and Watcom's WLink.


3.  What debuggers can I use for Windows development?

>>  First of all, if you use Actor, Smalltalk or ToolBook, you're limited
    to the debugging tools built into those packages.  If you are using
    C, C++ or another conventional language with Windows SDK, you have
    several choices.  
    
    1.	In real mode, you are limited to SYMDEB, which is pretty basic.  It
    	also requires the use of a second monitor (monochrome for most
	machines, 8514/A for MCA machines) or a serial terminal.  SYMDEB
	is included with the Windows SDK.

    2.	In standard mode, you can also use Codeview for Windows (CVW), which
	is included with Windows SDK, or Logitech's MultiScope (list: $500).
	CVW, which is similar to the DOS version of Codeview, requires a
	secondary monitor; a serial terminal can not be used.  CVW is
	included with the Windows SDK; MultiScope is a separate product.

	There is also a product called CV/1 (list: $149), which allows you
	to use CVW without a second monitor.

    3.	If you have a 386, you have an additional option of using WDEB386,
        which provides some further debugging features over CVW, at the
	expense of an antiquated user interface.  WDEB386, which is included
	with the SDK, will work wither with a secondary monitor or a serial
	terminal.


5.  What word processor can I use to create RTF files for the Windows SDK
    Help Compiler?

>>  The following will create RTF files:
	Lotus Ami Professional
	Microsoft Word
	Microsoft Word for Macintosh
	Microsoft Word for Windows
	Microsoft Word for Windows, Working Model   (limited file size)
    You can also create them manually, as the RTF format is plain ASCII,
    but this will very quickly get very awkward and very tedious.


6.  What does Windows do with my extended memory?  After I run Windows,
    Norton SI reports that I don't have any extended memory.  Is this
    a bug?

>>  No, it's not a bug.  Windows requires applications to access extended
    memory using a mechanism known as "XMS".  This mechanism is implemented
    in himem.sys.  If you have device=himem.sys in your config.sys, the
    first XMS call (by Windows or SmartDrive, for example) will transfer
    control of the extended memory to himem.sys, and thus make it in-
    accessible to non-XMS applications.


7.  How can I take a snapshot of my Windows screen?

>>  Simple -- just pres PrtScr, and Windows will copy the image to the
    clipboard, from where you can paste it into your favourite application.
    Using Alt-PrtScr will take a snapshot of only your current window.


    --------------------


8.  What do I need to develop device drivers for Windows?

>>  You need to purchase the Windows Device Driver Kit (DDK).  It's available
    direct from Microsoft, and costs $500.


    --------------------


9.  How can I hide dialog box controls?

>>  EnableWindow(GetDlgItem(hDlg, IDD_CONTROLTOHIDE), FALSE);
    ShowWindow(GetDlgItem(hDlg, IDD_CONTROLTOHIDE), SW_HIDE);
    UpdateWindow(GetDlgItem(hDlg, IDD_CONTROLTOHIDE));


10. How can I add pushbuttons and edit controls to a "normal" window which
    is not a dialog box?

>>  You can do this by simply calling CreateWindow() with one of the pre-
    defined child window control class names (see table 4.2 in the SDK
    reference manual).


11. Why does compiling a Windows application with emulator floating-point
    cause corrupted code segments when running on a non-87 machine?

>>  The emulated floating point tries to used the coprocessor. When it does
    not find one on startup, it patches the code to use the software floating
    point. Patching does however not adapt the code-segment checksum, thus
    the windows debugging version chokes when it horridly founds that some-
    thing terrible must have happened to the code.

    Get rid of it by setting 'EnableSegmentChecksum=0' in the [debug]
    section of WIN.INI; the problem only affects debugging versions of
    Windows.


    --------------------


12. How do I change the button colors?

>>  In Windows 3.0, the button face is defined by two colors. The grey
    (white if ega) face and a dark grey (grey if ega) shadow.  The colors
    also change when the button goes from a normal to pushed in state.  The
    WM_CTLCOLOR message only allows you to change one color at a time so to
    which of the button face colors should this apply?  (Windows 2 button
    faces had only one color so it made sense.)

    Maybe something tricky could have been done by using the background
    color for the shadow and foreground color for the face and perhaps
    doing something strange to get the text color in another way... And how
    do you return 2 brushes (you now need a foreground and a background
    brush)?  Or maybe even better, make colors a property of the window and
    some windows could have multiple color properties...

    Anyway, Windows doesn't look at the WM_CTLCOLOR message for buttons and
    thus doesn't allow you to change the button colors.  Try it with a
    listbox instead...  The only way to change button colors is to specify
    ButtonColor=, ButtonShadow= and ButtonText= in the [Colors] section of
    your win.ini file.


13. Why should I not use large model in my Windows application?  Can I do
    it anyway?

>>  Yes, you can do it.  There are several problems with using large model,
    though:
    i.  Your program's data memory will be fixed in real mode.  Effectively,
	your application will cripple any real-mode Windows system.
    ii. You will only be able to have one instance of your application
	active at any one time.
    iii.Your application will run more slowly.

    You should consider very carefully before you decide that large model
    is the only way to go; the preferred method is to use medium model, and
    to allocate far data as required.  
    
    Another alternative is to use Watcom C/386 for development; this will
    let you use a single 4GB segment, and 32-bit registers, increasing your
    applications performace substantially (but limiting it to running in 
    386 enhanced mode).


    --------------------

[ \tom haapanen --- university of waterloo --- tom@mims-iris.waterloo.edu ]
[ "i don't even know what street canada is on"               -- al capone ]
