home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_2.iso
/
windows
/
program
/
activex
/
axtsamp.exe
/
TSBRANCH.EXE
/
MARSHAL
/
MARSHAL.TXT
< prev
next >
Wrap
Text File
|
1997-01-05
|
5KB
|
100 lines
MARSHAL - Standard Marshaling of Custom Interfaces
SUMMARY
=======
The MARSHAL sample anticipates the interaction of client and
out-of-process server in the LOCCLIEN and LOCSERVE samples. For the
LOCCLIEN client to use the services in the LOCSERVE server requires
marshaling of the car-related interfaces used in the previous COM samples.
This code sample creates a standard marshaling server for the ICar,
IUtility, and ICruise custom interfaces.
The Microsoft Interface Definition Language (MIDL) compiler is used to
compile the interface specifications (expressed in MIDL in MICARS.IDL).
MIDL.EXE is a utility provided as part of the Win32 SDK. The MIDL
compilation of MICARS.IDL produces additional source files: MICARS.H,
MICARS_I.C, MICARS_P.C, and DLLDATA.C.
In the series of ActiveX Tutorial code samples, MARSHAL works with the
LOCSERVE and LOCCLIEN code samples to illustrate a COM client using the
interfaces on COM objects in an out-of-process local server. In these
lessons, only standard marshaling is used for the custom ICar, IUtility,
and ICruise interfaces.
For functional descriptions and a tutorial code tour of MARSHAL, see the
Code Tour section in MARSHAL.HTM. For details on setting up the
programmatic usage of MARSHAL, see the Usage section in MARSHAL.HTM. To
read MARSHAL.HTM, run TUTORIAL.EXE in the main tutorial directory and
click the MARSHAL lesson in the table of lessons. You can also achieve the
same thing by clicking the MARSHAL.HTM file after locating the main
tutorial directory in the Windows Explorer. See also LOCSERVE.HTM and
LOCCLIEN.HTM in the main tutorial directory for more details on this
client and server and how MARSHAL.DLL supports their operation. Because
those code samples rely on MARSHAL.DLL, you must build this MARSHAL DLL
before building or running LOCCLIEN and LOCSERVE. MARSHAL's makefile
automatically registers MARSHAL's proxy and stub interface handlers in the
system registry. This registration must be done before these interfaces
can be used by COM clients or servers in the LOCSERVE, LOCCLIEN, and later
samples of the series.
MARSHAL's self-registration is done using the REGISTER.EXE utility built
in the REGISTER sample. To build or run MARSHAL, you should build the
REGISTER code sample first.
For details on setting up your system to build and test the code samples
in this ActiveX Tutorial series, see TUTORIAL.HTM. The supplied MAKEFILE
is Microsoft NMAKE-compatible. To create a debug build, issue the NMAKE
command in the Command Prompt window.
Usage
-----
MARSHAL is a DLL that is built solely as a marshaling DLL for the
specified interfaces. Though it can be implicitly loaded by linking to its
associated .LIB file, it is normally used on behalf of a COM client of an
out-of-process server, in which case it is automatically loaded by COM as
needed. Before COM can find and load the MARSHAL DLL to support marshaling
of its supporeted interfaces, the MARSHAL server must be registered in the
registry as the marshaling server for those interfaces. MARSHAL is a
self-registering in-process server. The makefile that builds this sample
automatically registers the server in the registry. You can manually
initiate its self-registration by issuing the following command at the
command prompt in the MARSHAL directory:
nmake register
You can also directly invoke the REGISTER.EXE command at the command prompt
while in the MARSHAL directory.
..\register\register.exe marhsal.dll
These registration commands require a prior build of the REGISTER sample
in this series, as well as a prior build of MARSHAL.DLL.
FILES
=====
Files Description
MARSHAL.TXT This file.
MAKEFILE The generic makefile for building the MARSHAL.DLL
code sample.
MARSHAL.CPP The main implementation file for MARSHAL.DLL. Has DllMain
and the self-registration functions.
MARSHAL.RC The DLL resource definition file for the executable.
MARSHAL.ICO The icon resource for the executable.
MICARS.IDL The MIDL interface specifications for ICar, IUtility,
and ICruise.
MICARS.H Produced by compiling MICARS.IDL. The interface include
file for the specified interfaces.
MICARS_I.C Produced by compiling MICARS.IDL. The data definitions
of the GUIDs for the marshaled interfaces.
MICARS_P.C Produced by compiling MICARS.IDL. The actual proxy and
stub functions for the interface methods.
DLLDATA.C Produced by compiling MICARS.IDL. DLL data routines for
the proxies.