See the question and my original answer on StackOverflow

Although the current doc is not clear about these flags, when you use CoCreateInstance, you must specify the type of server used to manage the object, so COM can activate it (it's usually about inprocess vs out of process). Other flags such as CLSCTX_ENABLE_CLOAKING are optional.

The constants can be CLSCTX_INPROC_SERVER, CLSCTX_INPROC_HANDLER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER or any combination of these values. The constant CLSCTX_ALL is defined as the combination of all four.

CLSCTX_ALL means "I don't care whether it's inprocess, out-of-process, remote, etc.", but activate it.