BitmapEffect.CreateUnmanagedEffect 메서드

정의

주의

BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.

파생 클래스에서 재정의하는 경우 관리되지 않는 효과의 복제본을 만듭니다.When overridden in a derived class, creates a clone of the unmanaged effect.

protected:
 abstract System::Runtime::InteropServices::SafeHandle ^ CreateUnmanagedEffect();
[System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
protected abstract System.Runtime.InteropServices.SafeHandle CreateUnmanagedEffect ();
protected abstract System.Runtime.InteropServices.SafeHandle CreateUnmanagedEffect ();
[System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
[System.Security.SecurityCritical]
protected abstract System.Runtime.InteropServices.SafeHandle CreateUnmanagedEffect ();
[<System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")>]
abstract member CreateUnmanagedEffect : unit -> System.Runtime.InteropServices.SafeHandle
abstract member CreateUnmanagedEffect : unit -> System.Runtime.InteropServices.SafeHandle
[<System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")>]
[<System.Security.SecurityCritical>]
abstract member CreateUnmanagedEffect : unit -> System.Runtime.InteropServices.SafeHandle
Protected MustOverride Function CreateUnmanagedEffect () As SafeHandle

반환

SafeHandle

관리되지 않는 효과 복제본에 대한 핸들입니다.A handle to the unmanaged effect clone.

특성

예제

다음 예제에서는 메서드의 재정의를 보여 줍니다 CreateUnmanagedEffect .The following example demonstrates an override of the CreateUnmanagedEffect method.

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
unsafe protected override SafeHandle CreateUnmanagedEffect()
{
    const uint CLSCTX_INPROC_SERVER = 1;
    Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
    Guid guidEffectCLSID = new Guid("84CF07CC-34C4-460f-B435-3184F5F2FF2A");
    SafeHandle wrapper = BitmapEffect.CreateBitmapEffectOuter();

    COMSafeHandle unmanagedEffect;
    uint hresult = Ole32Methods.CoCreateInstance(
                        ref guidEffectCLSID,
                        wrapper.DangerousGetHandle(),
                        CLSCTX_INPROC_SERVER,
                        ref IID_IUnknown,
                        out unmanagedEffect);
    InitializeBitmapEffect(wrapper, unmanagedEffect);
    if (0 == hresult) return wrapper;
    throw new Exception("Cannot instantiate effect. HRESULT = " + hresult.ToString());
}
<SecurityPermissionAttribute(SecurityAction.Demand, Flags := SecurityPermissionFlag.UnmanagedCode)>
Protected Overrides Function CreateUnmanagedEffect() As SafeHandle
    Const CLSCTX_INPROC_SERVER As UInteger = 1
    Dim IID_IUnknown As New Guid("00000000-0000-0000-C000-000000000046")
    Dim guidEffectCLSID As New Guid("84CF07CC-34C4-460f-B435-3184F5F2FF2A")
    Dim wrapper As SafeHandle = BitmapEffect.CreateBitmapEffectOuter()

    Dim unmanagedEffect As COMSafeHandle
    Dim hresult As UInteger = Ole32Methods.CoCreateInstance(guidEffectCLSID, wrapper.DangerousGetHandle(), CLSCTX_INPROC_SERVER, IID_IUnknown, unmanagedEffect)
    InitializeBitmapEffect(wrapper, unmanagedEffect)
    If 0 = hresult Then
        Return wrapper
    End If
    Throw New Exception("Cannot instantiate effect. HRESULT = " & hresult.ToString())
End Function

적용 대상