RealProxy.SupportsInterface(Guid) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Vraagt een COM-interface aan met de opgegeven id.
public:
virtual IntPtr SupportsInterface(Guid % iid);
public virtual IntPtr SupportsInterface(ref Guid iid);
abstract member SupportsInterface : Guid -> nativeint
override this.SupportsInterface : Guid -> nativeint
Public Overridable Function SupportsInterface (ByRef iid As Guid) As IntPtr
Parameters
- iid
- Guid
Een verwijzing naar de aangevraagde interface.
Retouren
nativeint
Een aanwijzer naar de aangevraagde interface.
Voorbeelden
[SecurityPermission(SecurityAction::LinkDemand, Flags = SecurityPermissionFlag::Infrastructure)]
IntPtr SupportsInterface( Guid * /*myGuid*/ )
{
Console::WriteLine( "SupportsInterface method called" );
// Object reference is requested for communication with unmanaged objects
// in the current process through COM.
IntPtr myIntPtr = this->GetCOMIUnknown( false );
// Stores an unmanaged proxy of the object.
this->SetCOMIUnknown( myIntPtr );
// return COM Runtime Wrapper pointer.
return myIntPtr;
}
public override IntPtr SupportsInterface(ref Guid myGuid)
{
Console.WriteLine("SupportsInterface method called");
// Object reference is requested for communication with unmanaged objects
// in the current process through COM.
IntPtr myIntPtr = this.GetCOMIUnknown(false);
// Stores an unmanaged proxy of the object.
this.SetCOMIUnknown(myIntPtr);
// return COM Runtime Wrapper pointer.
return myIntPtr;
}
<SecurityPermission(SecurityAction.LinkDemand, Flags := SecurityPermissionFlag.Infrastructure)> _
Public Overrides Function SupportsInterface(ByRef myGuid As Guid) As IntPtr
Console.WriteLine("SupportsInterface method called")
' Object reference is requested for communication with unmanaged objects
' in the current process through COM.
Dim myIntPtr As IntPtr = Me.GetCOMIUnknown(False)
' Stores an unmanaged proxy of the object.
Me.SetCOMIUnknown(myIntPtr)
' return COM Runtime Wrapper pointer.
Return myIntPtr
End Function 'SupportsInterface
Opmerkingen
Met SupportsInterface de methode kan het huidige proxy-exemplaar extra COM-interfaces implementeren namens het serverobject dat het huidige exemplaar vertegenwoordigt. De huidige methode genereert de aangevraagde interface en retourneert een aanwijzer. De typen COM-interfaces die met deze methode kunnen worden gegenereerd, zijn afhankelijk van het proxytype, dat op zijn beurt afhankelijk kan zijn van het type serverobject dat het huidige proxy-exemplaar vertegenwoordigt.
Zie ProxyAttribute voor meer informatie.