pythoncom.gif
blank.gif Next blank.gif Home Page

Class BasicWrapPolicy - The base class of policies.


SYNOPSIS

import win32com.server.policy
class BasicWrapPolicy
  def _CreateInstance_(self, clsid, reqIID)
  def _GetIDsOfNames_(self, names, lcid)
  def _Invoke_(self, dispid, lcid, wFlags, args)
  def _QueryInterface_(self, iid)
  def __init__(self, object)
  def _getidsofnames_(self, names, lcid)
  def _invoke_(self, dispid, lcid, wFlags, args)
  def _query_interface_(self, iid)
  def _wrap_(self, object)

DESCRIPTION

Normally not used directly (use a child class, instead)

This policy assumes we are wrapping another object as the COM server. This supports the delegation of the core COM entry points to either the wrapped object, or to a child class.

This policy supports the following special attributes on the wrapped object

_query_interface_
A handler which can respond to the COM QueryInterface call.
_com_interfaces_
An optional list of IIDs which the interface will assume are valid for the object.
_invoke_
A handler which can respond to the COM Invoke call. If this attribute is not provided, then the default policy implementation is used. If this attribute does exist, it is responsible for providing all required functionality - ie, the policy _invoke_ method is not invoked at all (and nor are you able to call it!)
_getidsofnames_
A handler which can respond to the COM GetIDsOfNames call. If this attribute is not provided, then the default policy implementation is used. If this attribute does exist, it is responsible for providing all required functionality - ie, the policy _getidsofnames_ method is not invoked at all (and nor are you able to call it!)

def _CreateInstance_(self, clsid, reqIID)

Creates a new instance of a wrapped object

This method looks up a "win32com.server.policy.regSpec" % clsid entry in the registry (using DefaultPolicy)

def _GetIDsOfNames_(self, names, lcid)

The main COM entry-point for GetIDsOfNames.

This checks the validity of the arguments, and calls the _getidsofnames_ helper.

def _Invoke_(self, dispid, lcid, wFlags, args)

The main COM entry-point for Invoke.

This calls the _invoke_ helper.

def _QueryInterface_(self, iid)

The main COM entry-point for QueryInterface.

This checks the _com_interfaces_ attribute and if the interface is not specified there, it calls the derived helper _query_interface_

def __init__(self, object)

Initialise the policy object

Params:

object
The object to wrap. May be None iff BasicWrapPolicy._CreateInstance_ will be called immediately after this to setup a brand new object

def _getidsofnames_(self, names, lcid)

A stub for _getidsofnames_ - should never be called.

Simply raises an exception.

def _invoke_(self, dispid, lcid, wFlags, args)

A stub for _invoke_ - should never be called.

Simply raises an exception.

def _query_interface_(self, iid)

Called if the object does not provide the requested interface in _com_interfaces, and does not provide a _query_interface_ handler.

Returns a result to the COM framework indicating the interface is not supported.

def _wrap_(self, object)

Wraps up the specified object.

This function keeps a reference to the passed object, and may interogate it to determine to to respond to COM requests, etc.

SEE ALSO

win32com.server.policy


blank.gif Next blank.gif Home Page
www_icon.gif

Copyright © Greg Stein and Mark Hammond
All Rights Reserved
Comments to author: dev@null
Generated: Sun Apr 20 1997