IMAPI version 2 is well designed – no arguments – file systems, recorders, data streams, notifications, dispatch interfaces to be compatible with scripting, higher level development environments and interoperation layer. Still I am armed with C++ at the very moment and back to type library imports using #import.
I want to know why the hell it is required to sort out mess even between the two API modules: IMAPI2.DLL and IMAPI2FS.dll:
#pragma warning(disable: 4192)
#import “libid:2735412F-7F64-5B0F-8F00-5D77AFBE261E” no_namespace raw_interfaces_only raw_dispinterfaces // IMAPI2
#import “libid:2C941FD0-975B-59BE-A960-9A2A262853A5” no_namespace raw_interfaces_only raw_dispinterfaces exclude(“_IMAPI_MEDIA_PHYSICAL_TYPE”, “IDiscRecorder2”) // IMAPI2FS
#pragma warning(default: 4192)
In order to import into C++ project, it is required to exclude two items which are duplicate between the modules. OMFG.
Still it is not the end. Since I am subscribing to events using ATL’s IDispEventImpl and SINK_ENTRY_EX, I need DISPID values for the Update methods of DDiscFormat2DataEvents and DFileSystemImageEvents. How do I find them? Type library as usual? No, my dear friend, type library does not mention this useless value… For further reference:
- DFileSystemImageEvents::Update – DISPID is 256
- DDiscFormat2DataEvents::Update – DISPID is 512