

README File

Messaging Programmer's Reference
for the Microsoft(R) Windows(TM) Software Development Kit

(C) Copyright Microsoft Corporation, 1992-1993


This README describes the files included on this product's disk that
help you create custom commands and custom message types, and help 
you use MAPI functions. It also includes a correction to the sample 
code for sending messages described on page 86 of the reference.


-----------------------------------------------------------------------
Supplied Files - Custom Commands
-----------------------------------------------------------------------

Several files are included on this product's disk to help you create custom
commands. The following files are in the \MAILEXTS directory of the drive 
path specified at installation (default = \WGTOOLS).

APPEXEC.DLL
Use this DLL to create custom commands that start another application
and pass information to it on the command line. You dont need to write
any additional code to try this DLL. 

EMPTYWB.DLL
This DLL implements a custom command that purges any messages in the 
Mail Deleted Mail folder. 

MAILEXTS.H
This C header file declares the Command function and the parameter block 
structure Mail passes to custom command DLLs. It also defines constant 
values used in some elements of the parameter block. For more 
information, see "DLL Parameter Block" in the Messaging Programmer's
Reference.

SHARED.INI
This text file contains sample shared custom command declarations. For 
more information, see "Installing Shared Custom Commands" in the 
Messaging Programmer's Reference.

-----------------------------------------------------------------------
The following are in the \MAILEXTS\APPEXEC subdirectory of the drive path 
specified during installation. For more information about how these files 
are used to build APPEXEC.DLL, see "Building a Sample DLL" in the Messaging
Programmer's Reference.

APPEXEC
This is the makefile for APPEXEC.DLL.

APPEXEC.C
This file contains the C source code for APPEXEC.DLL.

APPEXEC.DEF
This is the linker definition file for APPEXEC.DLL.

APPEXEC.H
This is the APPEXEC header file containing definitions, functions, and 
source command line token information.

APPEXEC.RC
This is the Windows rdefinition file for APPEXEC.DLL.


-----------------------------------------------------------------------
Supplied Files - Custom Message Types
-----------------------------------------------------------------------
The following files are in the \MAILEXTS directory of the drive path 
specified during installation. 

APPEXEC.DLL
This DLL can be used to create custom message types. 

APPEXEC.H
This is the APPEXEC header file containing definitions, functions, and 
command line token information.

HELPREQ.EXE
This is the executable file for the HELPREQ message type. 

HELPREQ.INI
This file contains initialization information for the HELPREQ.EXE 
application.

MAILEXTS.H
This C header file declares the Command function and the parameter block 
structure Mail passes to custom message type DLLs. It also defines
constant values used in some elements of the parameter block. For more
information about this file, see "DLL Parameter Block" in the Messaging
Programmer's Reference.

SHARED.INI
This text file contains a sample shared custom message type declaration. 
For more information, see "Installing Shared Custom Message Types" 
in the Messaging Programmer's Reference.

-----------------------------------------------------------------------
The following files are in the \MAILEXTS\HELPREQ directory of the drive 
path specified at installation. They contain code for a sample Help Request
message type. For more information about how these files are used to build 
HELPREQ.EXE, see "Building a Sample Custom Message Type" in the Messaging 
Programmer's Reference.

HELPREQ
This is the make script for HELPREQ.EXE.

HELPREQ.C
This contains the C source code for HELPREQ.DLL.

HELPREQ.DEF
This is the linker definition file for HELPREQ.DLL.

HELPREQ.RC
This is the Windows resource definition file for HELPREQ.DLL.


-----------------------------------------------------------------------
Supplied Files - MAPI C
-----------------------------------------------------------------------
The following files are included on this product's disk to help you use the
MAPI functions. They are in the \MAPI.C directory of the drive path 
specified during installation.
	
MAPI.H 	
This C header file declares the simple MAPI functions and defines constant 
values returned on errors.

MAPI.HLP
This is the online help executable for MAPI for C.


-----------------------------------------------------------------------
Supplied Files - MAPI VB
-----------------------------------------------------------------------
The following files are included on this product's disk to help you use the
MAPI functions. They are in the \MAPI.VB directory of the drive path 
specified during installation. Note that these files require version 2.0 
or greater of Visual Basic.

MAPI.BAS	
This BASIC file contains MAPI declarations to be linked into mail-enabled
Visual Basic application code. 

MAPIVB.BAS	
This BASIC file contains the support code for the simple MAPI Visual Basic 
functions.

MAPI.TXT 	
This file contains global MAPI declarations to be copied to the global
declaration module when writing mail-enabled Visual Basic applications.

MAPIVB.HLP
The online help executable for MAPI for VB.

-----------------------------------------------------------------------
The following file is  in the \MAPI.VB\SAMPLE directory of the drive path 
specified at installation.

MAPIDEMO.MAK
A sample VB 2.0 application that uses the MAPI Visual Basic functions to
perform various mail functions such as sending and receiving mail.  


-----------------------------------------------------------------------
MAPISendMail Example
-----------------------------------------------------------------------
On page 86 of the Messaging Programmer's Reference, there are two examples
showing how to send a message with an attachment using MAPISendMail. The 
second example contains some errors, so please use the following version:



#include <windows.h>
#include <stdio.h>
#include <mapi.h>

void f1()
{
 long err;
 MapiFileDesc file = { 0, 0, -1L, "c:\tmp\tmp.wk3", "budget17.wk3", NULL };
 MapiMessage note = { 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL, 1,
  	&file };

 err = MAPISendMail(0L, 0L, &note, MAPI_DIALOG, 0L);
  if (err != SUCCESS_SUCCESS)
	  printf("Unable to send the message\n");
}

void f2()
{
 long err;
 MapiFileDesc file = { 0, 0, -1L, "c:\tmp\tmp.wk3", "budget17.wk3", NULL };
 MapiMessage note = { 0, NULL,
	"Attached is the budget proposal.\r\nSee you Monday.\r\n",
	NULL, NULL, NULL, 0, NULL, 2, NULL, 1, &file };
 MapiRecipDesc recip[2];

 recip[0].ulReserved = 0;
 recip[0].ulRecipClass = MAPI_TO;
 recip[0].lpszName = "Sally Jones";
 recip[0].lpszAddress = NULL;
 recip[0].ulEIDSize = 0;
 recip[0].lpEntryID = NULL;

 recip[1].ulReserved = 0;
 recip[1].ulRecipClass = MAPI_CC;
 recip[1].lpszName = "Marketing";
 recip[1].lpszAddress = NULL;
 recip[1].ulEIDSize = 0;
 recip[1].lpEntryID = NULL;

 note.lpRecips = recip;

 err = MAPISendMail(0L, 0L, &note, 0L, 0L);
 if (err != SUCCESS_SUCCESS)
	 printf("Unable to send the message\n");
}




