Ejemplo n.º 1
0
def DumbDispatch(IDispatch, userName = None, createClass = None,UnicodeToString=None, clsctx=pythoncom.CLSCTX_SERVER):
	"Dispatch with no type info"
	assert UnicodeToString is None, "this is deprecated and will go away"
	IDispatch, userName = _GetGoodDispatchAndUserName(IDispatch,userName,clsctx)
	if createClass is None:
		createClass = CDispatch
	return createClass(IDispatch, build.DispatchItem(), userName)
Ejemplo n.º 2
0
def DumbDispatch(IDispatch,
                 userName=None,
                 createClass=None,
                 UnicodeToString=NeedUnicodeConversions,
                 clsctx=pythoncom.CLSCTX_SERVER):
    "Dispatch with no type info"
    IDispatch, userName = _GetGoodDispatchAndUserName(IDispatch, userName,
                                                      clsctx)
    if createClass is None:
        createClass = CDispatch
    return createClass(IDispatch, build.DispatchItem(), userName,
                       UnicodeToString)
Ejemplo n.º 3
0
def MakeOleRepr(IDispatch, typeinfo, typecomp):
	olerepr = None
	if typeinfo is not None:
		try:
			attr = typeinfo.GetTypeAttr()
			# If the type info is a special DUAL interface, magically turn it into
			# a DISPATCH typeinfo.
			if attr[5] == pythoncom.TKIND_INTERFACE and attr[11] & pythoncom.TYPEFLAG_FDUAL:
				# Get corresponding Disp interface;
				# -1 is a special value which does this for us.
				href = typeinfo.GetRefTypeOfImplType(-1);
				typeinfo = typeinfo.GetRefTypeInfo(href)
				attr = typeinfo.GetTypeAttr()
			if typecomp is None:
				olerepr = build.DispatchItem(typeinfo, attr, None, 0)
			else:
				olerepr = build.LazyDispatchItem(attr, None)
		except pythoncom.ole_error:
			pass
	if olerepr is None: olerepr = build.DispatchItem()
	return olerepr