Doug Fort
Beg 4 Death Software
Arlington VA
70233,1501

Windows NT - Revised Exception Handling Example
===============================================

This is a revision of except.zip.  The March Beta changed
the prototype of FormatMessage() (in winbase.h) to take
var_list as arg #7 instead of LPDWORD.  I have revised the
code to account for this.  The argument passing is now 
kind of kludgy:  I welcome comments on other approaches.

As a developer, I think that Structured Exception Handling is
one of the most attractive features of NT.  I want to share 
what I've stumbled through in my first effort.  There isn't 
much here, but I haven't seen a good example anywhere else.
  
The approach here is to generate a Message Compiler source 
(.MC) file.  From this, the Message Compiler (MC.EXE) creates 
a binary (string) resource, a Resource Compiler Source (.RC) 
file and a C Language Header (.H) file.  
The string resource is built into a resource-only DLL using the
.RC file.  The .H file is used by programs to generate
exception codes. (See WINERROR.H for the system exceptions) 

This package contains the ingredients of a demo-version DLL, 
(B4DMSG.DLL) and for a small program (MAIN.EXE) to force an 
exception when a key is pressed.

Sources:
========

1.  David Soloman's presentation on "Structured Exception Handling"
at the October Developer's Conference in Santa Clara.

2.  the RESDLL (Resource only DLL) sample on the October CD.

3.  the PDC sample.

Contents:

The DLL
=======

B4DMSG.MAK
Builds the dll, this comes from the readme file in the
RESDLL example on the October SDK CD.
	
THE_DLL.C
Boilerplate DLL wrapper, this comes from the readme file in 
the RESDLL example on the October SDK CD.

B4DMSG.DEF
Module Definition file for the DLL, from RESDLL.

B4DMSG.MC
Message compiler source file.  The best documentation
for this is MC.HLP.

B4DMSG.H
Header file generated by MC.EXE from B4DMSG.MC.  I threw this in
so you don't have to run the make to see it.  See also WINERROR.H.

A Class to hide the DLL
========================
B4DMSGRS.H
Class definition for B4DMsgResource, a class that hides the
Exception DLL.

B4DMSGRS.CPP
Class implementation for B4DMsgResource, a class that hides the
Exception DLL.

The demo program
=================

MAIN.DEF
Module Definition file for the Demo Program.
Copied from RESDLL

MAIN.H
Header file for the Demo Program.
Copied from RESDLL

MAIN.MAK
Make file for the Demo Program.
Copied from RESDLL

MAIN.CPP
Source file for the Demo Program.
Copied from RESDLL

MAKEFILE
This builds the whole pizza.  Note that the DLL 
must be built before the EXE.


