Step One: Create the Project

I used Visual C++ version 2.1 (MFC 3.1) to create the project. In AppWizard, I selected MFC AppWizard (dll) as the type of project. I also selected the option called Use MFC In A Static Library, to specify how to link to the MFC library. With the default option (using MFC in a shared DLL), the MFC classes won't work correctly if your COM object is used by some non-MFC application. So you must use the static library instead.

I decided to include OLE Automation as an option in my sample file viewer. It's easier to add it when you create the project than to go back later and add it yourself.

At this point, I built the project to be sure that everything was OK.

.