-----------------------------
C-API Message Interface (CMI)
-----------------------------

To call wdCommandDispatch, a DLL (or WLL) must be called by Word;
otherwise stack problems occur (GPF).  This means that it is not 
possible to call a DLL or WLL from an application other than Word 
and then have the called DLL or WLL drive Word.

CMI is a way to get around this problem. When making a C-API call, 
the DLL can send a message to Word (WM_WDCAPI) instead of calling 
wdCommandDispatch.  As a result, Word calls wdCommandDispatch from 
its own stack (avoiding stack problems) when it processes the 
message.


-- To use CMI:

1) Include the following in a header file:

#include "wdcapi.h"
#define WM_WDCAPI    (WM_USER + 0x0300)

typedef struct
{
	short CommandID;
	short DlgOptions;
	short cArgs;
	LPWDOPR lpwdoprArgs;
	LPWDOPR lpwdoprReturn;
} CMI;
typedef CMI far *LPCMI;


2) Fill the CMI structure.

3) Call SendMessage in the following way:

err = (int)SendMessage( hWordWnd, WM_WDCAPI, 0, (LPARAM)(LPCMI)&cmi );
