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
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.
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:
DllMain
as the entry point. C run-time libraries are not linked inThis 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