MINIMAL: Implements a Minimalist DLL Server

Click to open or copy the MINIMAL project files.

This sample implements a minimalist DLL server to show how DLLs developed with ATL can be very small.

The server has a single COM object, which contains one custom interface with one method.

Running the Sample

  1. Build MINIMAL.DLL.

    The DLL is not self-registering, so you must use REGEDIT to merge the provided Minimal.reg file. Minimal.dll does not have a path specified under the InProcServer32 key (that is, InProcServer32 = minimal.dll). You must either modify the entry with a full path (for example, InProcServer32 = C:\<your path>\minimal.dll) or have your DLL in the system path.

  2. Open the MINDRIV project (a console application) in the MINIMAL\MINDRIV subdirectory.

  3. Build and run the application from the debugger or the command line.

Remarks

The MINIMAL sample does not make use of an ODL or an IDL file to define the interfaces. Instead, it shows how to define custom interfaces directly from C++ (see Minimal.h).

The DLL server's size is reduced because:

This sample uses the following keywords:

_CrtDumpMemoryLeaks; _tprintf; _vstprintf; ATLASSERT; BEGIN_COM_MAP; BEGIN_OBJECT_MAP; CComCoClass; CComModule::GetClassObject; CComModule::GetLockCount; CComModule::Init; CComModule::Term; CComObjectRoot; CoCreateInstance; COM_INTERFACE_ENTRY; CoUninitialize; DECLARE_NO_REGISTRY; DECLARE_NOT_AGGREGATABLE; DisableThreadLibraryCalls; END_COM_MAP; END_OBJECT_MAP; OBJECT_ENTRY; OutputDebugString; va_end; va_list; va_start