Help:CoCreateInstance()的dwClsContext参数
ecai 2002-06-03 04:32:35 BTW:CoCreateInstance()的dwClsContext参数
CLSCTX_INPROC_SERVER
The code that creates and manages objects of this class runs in the same process as the caller of the function specifying the class context.
CLSCTX_LOCAL_SERVER
The EXE code that creates and manages objects of this class is loaded in a separate process space (runs on same machine but in a different process).
这两个定义比较清楚,请看下面
#define CLSCTX_SERVER (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)
#define CLSCTX_ALL (CLSCTX_INPROC_HANDLER | CLSCTX_SERVER)
那么使用CLSCTX_ALL创建COM对象时系统怎么选择让COM对象是作为Inproc Server运行还是作为Local Server运行呢?