by jasper » 31 July 2014, 09:40
The main CPP, h and def file (CPPMixerSplitterExample.cpp) are largely generated by visual studio as part of making a new project (new C++ project, ATL, default options, finish).
Class bodies, IDL and function headers are generated by the class wizard (new ATL class, simple) and implementing COM interfaces (right click class in the class view, add, implement interface, select the CAPE-OPEN tlb; I would recommend copying the tlb in the project folder for maintainability; this will also add #import with the full tlb path to stdafx.h, from which I would remove the full path as well as duplicate occurances (one will be added for each implemented interface); note that older version of the wizard have a bug that translate VARIANT_BOOL to BOOL, you will have to manually correct that).
Utility classes (BSTR, VARIANT) you can just copy. Or use ATL's versions.
The project TLB and import headers are generated from MIDL. The CAPE-OPEN inport headers are generated from MIDL. Both are part of the compilation step.
For the default COM server, you can remove the option to register the type library (second argument to (Un)RegisterServer); the only type information that should be relevant is that in the CAPE-OPEN type libs, and need not be registered as part of your DLL.
Resource.h and the rc file are generated by Visual studio. The rgs files are created for new COM classes, and you should remove the ones (including the reference from the resource file) for those classes that do not require registration. Change DECLARE_REGISTRY_RESOURCEID(IDR_XXXX) to DECLARE_NO_REGISTRY() for such classes. Typically only PMC primary objects require registration, as they need to be found by CoCreateInstance.
The aps file is a result of compilation, and can be removed if you like.
If you re-use files from this project or the project altogether, make sure to change the GUIDS (IDL file, rgs files; make sure to change the rgs files consistent with the IDL file).
I have stepped away myself from using ATL for CAPE-OPEN objects in favour of my own framework. Contact me if you are interested. Let me know if you have further questions.