C# Class Microsoft.Scripting.ComInterop.ComEventSinkProxy

ComEventSinkProxy class is responsible for handling QIs for sourceIid on instances of ComEventSink. Background: When a COM even sink advises to a connection point it is supposed to hand over the dispinterface. Now, some hosts will trust the COM client to pass the correct pointer, but some will not. E.g. Excel's implementation of Connection Points will not cause a QI on the pointer that has been passed, however Word will QI the pointer to return the required interface. ComEventSink does not, strongly speaking, implements the interface that it claims to implement - it is just "faking" it by using IReflect. Thus, Word's QIs on the pointer passed to ICP::Advise would fail. To prevent this we take advangate of RealProxy's ability of "dressing up" like other classes and hence successfully respond to QIs for interfaces that it does not really support( it is OK to say "I implement this interface" for event sinks only since the common practice is to use IDistpach.Invoke when calling into event sinks).
Inheritance: System.Runtime.Remoting.Proxies.RealProxy
ファイルを表示 Open project: jschementi/iron Class Usage Examples

Public Methods

Method Description
ComEventSinkProxy ( ComEventSink sink, System.Guid sinkIid ) : System
SupportsInterface ( System.Guid &iid ) : IntPtr

Private Methods

Method Description
ComEventSinkProxy ( ) : System
Invoke ( IMessage msg ) : IMessage

Method Details

ComEventSinkProxy() public method

public ComEventSinkProxy ( ComEventSink sink, System.Guid sinkIid ) : System
sink ComEventSink
sinkIid System.Guid
return System

SupportsInterface() public method

public SupportsInterface ( System.Guid &iid ) : IntPtr
iid System.Guid
return System.IntPtr