Name
CoCreateInstance( )
Synopsis
Creates the specified COM object and returns the requested interface.
interface = CoCreateInstance(clsid, unkOuter , clsctx , iid)
Parameters
-
clsid A string or
PyIIDobject containing the class ID for the new object.-
unkOuter Typically
None, or may be a Python interface object if the object is used as part of an aggregate.-
clsctx Defines the context in which the code that manages the newly created object runs. May be a combination of the following constants:
-
pythoncom.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.
-
pythoncom.CLSCTX_INPROC_HANDLER The code that manages objects of this class is an in-process handler. This is a DLL that runs in the client process and implements client-side structures of this class when instances of the class are accessed remotely.
-
pythoncom.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).
-
pythoncom.CLSCTX_REMOTE_SERVER A remote machine context. The LocalServer32 or LocalService code that creates and manages objects of this class is run on a different machine.
-
pythoncom.CLSCTX_ALL Indicates all class contexts.
-
pythoncom.CLSCTX_INPROC Indicates all in-process contexts.
-
pythoncom.CLSCTX_SERVER Indicates server code, whether in-process, local, or remote.
-
iid A string or
PyIIDobject that defines ...
-
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access