Python COM and DCOM.

Syver Enstad syver at NOSPAMcyberwatcher.com
Fri Jan 19 19:53:18 EST 2001


Alex wrote:
> If you register a COM object as having different servers (in-process,
> local aka out-of-process, remote), the fastest one of these will
> always be used by 'default instance creation methods' in all
> languages.  You will need to de-register the 'faster' (in-process,
> local) servers if you want 'slower' servers to be used for such
> default creation.
I've deregistered the inproc server option, registered the python com class
with _reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER as a class variable


> Or else (not available from all languages) you can explicitly ask
> for the kind of server you want by passing appropriate values from
> the CLSCTX enumeration:
>
> typedef enum tagCLSCTX
> {
>     CLSCTX_INPROC_SERVER    = 1,
>     CLSCTX_INPROC_HANDLER   = 2,
>     CLSCTX_LOCAL_SERVER     = 4,
>     CLSCTX_REMOTE_SERVER    = 16,
>     CLSCTX_NO_CODE_DOWNLOAD = 400,
>     CLSCTX_NO_FAILURE_LOG = 4000
> } CLSCTX;
> #define CLSCTX_SERVER    (CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER |
> CLSCTX_REMOTE_SERVER)
> #define CLSCTX_ALL       (CLSCTX_INPROC_HANDLER | CLSCTX_SERVER)

Yes, I know. This seems to work okay. The problem is when you already have
compiled code (that uses default instance creation methods) or ASP that as
far as I've seen from the docs doesn't support CLSCTX specification.





More information about the Python-list mailing list