Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Part 4: Appendixes > pythoncom Module - Pg. 533

CoCreateInstance( ) 533 used as the window title instead. This parameter must be None for GUI or console processes that don't create a new console window. wShowWindow Can be any of the SW_ constants defined in win32con. For GUI processes, this specifies the default value the first time ShowWindow() is called. pythoncom Module The pythoncom module provides the low-level interface between COM and Python. CoCreateInstance( ) Creates the specified COM object and returns the requested interface. interface = CoCreateInstance(clsid, unkOuter , clsctx , iid) Parameters clsid A string or PyIID object 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 struc- tures 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. This is the Title of the Book, eMatter Edition Copyright © 2008 O'Reilly & Associates, Inc. All rights reserved.