Ok I got the solution to this from another forum:
and it is this: Have to write my own litgen.h like follows:
#include <initguid.h> // for some compilers the name of this may be different
extern "C" {
.
.
DEFINE_GUID( IID_ILITWriter, 0x9EC81687,0xD4F9,0x4b20,0x96,0x9A,0x22,0x2B,0xC0,0x0C,0xE5,0x0A);
.
.
}
now here the DEFINE_GUID is a macro from initguid.h that binds the hex values to some structure and makes the name IID_ILITWriter meaningful. From this on the IID_ILITWriter is an initialized variable of type REFIID and can be passed to the QueryInterface method.
As you may notice the values above are taken from the .idl , just as I suspected.
stu_design:
I am writing a simple commandline application for windows that will convert OEB (Open eBook) file collections (== almost same as having an eBook in HTML format) into Microsoft Reader ebooks (.lit files). For the purpose of creating .lit files Microsoft provides 'Content SDK' which is free to download and to use for non-commercial purposes. The key component in 'Content SDK' is the litgen.dll this is COM DLL but not every COM feature is implemented. Usage guide and sample code comes with 'Content SDK'. BUT the sample code for using litgen.dll is written for Visual C++. Now the Visual C++ is expensive and in my opinion "obfuscating" environment. I much more prefer e.g. mingw compiler which is totally free of charge gcc variant (GNU license), really lean and small, capable of creating all types of windows applications and libraries. And for mingw there is this really good free IDE: Dev-C++ by BloodshedSoftware (under GNU license also).
Visual C++ is obfuscating because there is no attempt whatsoever to keep things simple. Microsoft just loads macros on top of macros in attempt to make all things running "behind the curtains". This was my experience when I used Visual C++ in my previous office.