C# Класс 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).
Наследование: System.Runtime.Remoting.Proxies.RealProxy
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ComEventSinkProxy ( ComEventSink sink, System.Guid sinkIid ) : System
SupportsInterface ( System.Guid &iid ) : IntPtr

Приватные методы

Метод Описание
ComEventSinkProxy ( ) : System
Invoke ( IMessage msg ) : IMessage

Описание методов

ComEventSinkProxy() публичный Метод

public ComEventSinkProxy ( ComEventSink sink, System.Guid sinkIid ) : System
sink ComEventSink
sinkIid System.Guid
Результат System

SupportsInterface() публичный Метод

public SupportsInterface ( System.Guid &iid ) : IntPtr
iid System.Guid
Результат System.IntPtr