Re: Windows program category
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sun, 19 Jun 2005 13:21:41 -0400
The distinctions tend to deal with the structure of the program.
GUI apps have windows the user interacts with. They could be written in raw Win32 API,
using MFC, using VB, using C#, etc. Key is that they have the windowing models of
interaction we are familiar with. They have no stdin, stdout, or stderr connections. All
GUI apps start with a WinMain, whether you code it or it is built into the runtime (as it
is in C#, VB and MFC)
Console apps are an old-style app that has no direct user interfaction via graphical
components. They are configured by command-line parameters, typically read input from
either stdin or a file whose name is specified on the command line, and write output to
stderr, stdout, or a file determined, directly or indirectly from the command line
information. All console apps start with main(), which takes argc and argv parameters in
the traditional C model.
System services run under control of the Service Control Manager. They rarely, if ever,
have a GUI component, and putting a GUI component into one is a fascinating and delicate
process best avoided. They have no stdin, stdout or stderr. There are very special rules
about how they are constructed, registering the services, the service control handler, and
following fairly precise protocols for their interface with the operating system.
Device drivers run in the kernel. They are incredibly complicated just in the
infrastructure (by comparison to the infrastructure, actually talking to the hardware is
essentially trivial). There are incredibly complicated protocols for interacting with the
rest of the system. Concepts such as GUI, stdout, etc. are completely foreign. There are
subcategories of device drivers, such as layered drivers (receive input from drivers above
them and send requests to drivers below them), top-level drivers (receive input from the
I/O Manager and talk to lower-level drivers), hardware drivers (receive requests from
upper level drivers and talk to hardware), miniport drivers (receive requests via special
"port-miniport" interfaces and talk to hardware), monolithic drivers (fairly rare these
days: talk to the I/O Manager at one side and hardware at the other).
Static libraries are not programs. Static libraries are collections of code that can be
linked into any of the above structures.
DLLs are not programs. DLLs are libraries that are loaded at runtime. ActiveX controls,
COM components, control panel applets, and device drivers are interesting forms of DLLs
(yes, device drivers are really just DLLs: look at the structure of the file, and how it
is loaded. Device drivers get loaded by the kernel equivalent of LoadLibrary).
DLLs serve many purposes. For example, DLLs which obey certain rules could be control
panel applets, Internet Explorer plugins, Shell Extensions, ActiveX controls, COM
interfaces, print spooler port monitors, print spooler language monitors, and the like.
Some of the option tabs for printer setup are DLLs provided by the printer vendor which
obey the rules for being a printer setup extension mechanism. Display drivers are a
special kind of DLL loaded by the kernel, but they are somewhat different from ordinary
device drivers in their infrastructure (they contain the device driver infrastructure as a
subset).
I'm not aware of any one place that describes all of these separately. There are books on
Device Drivers [I co-authored one], books on Shell Programming, books on general DLL
programming, books on ActiveX, COM, and OLE programming, and the like, but I'm not sure
there is any one book that explains all of this.
joe
On Sat, 18 Jun 2005 22:14:33 -0600, "Johnson Liuis" <gpsabove@xxxxxxxxx> wrote:
>A beginner's question.
>
>I once read an article that divided the windows program into several
>categories, like Windows Device Driver, Applications (GUI, Comnsole, DLL,
>Static Library, and ?), and Windows Service, and I could not remember the
>whole list. I am sure I missed, could anybody please give me some tips or
>give me a link or provide me a book? I really want to have a whole picture
>of Windows programming.
>
>Thanks.
>
>Johnson
>
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Prev by Date: Re: Tips to hide "Debug Assertion Failed!"
- Next by Date: Re: OnTimer never gets called in the dialog box.
- Previous by thread: Re: Beginner to GUI
- Next by thread: Problem with windows messages routing, DoModal and MessageBox
- Index(es):
Relevant Pages
|