locked
How to acquire a ComPtr (WRL) to CryptographicBuffer?

    Question

  • Hi,

    when i try this:

    --------------

    HStringReference ref(RuntimeClass_Windows_Security_Cryptography_CryptographicBuffer);

    ComPtr<ABI::Windows::Security::Cryptography::ICryptographicBufferStatics> cryptographicBuffer;

    HRESULT hr = Windows::Foundation::ActivateInstance<ABI::Windows::Security::Cryptography::ICryptographicBufferStatics>(ref.Get(), &cryptographicBuffer);

    ----------------

    I get a not implemented hr.

    This class has the "StaticAttribute" set.

    How can i get a valid ComPtr to this type which contains only static members?

    Monday, August 27, 2012 1:36 PM

Answers

  • Ok i solved the problem myself:

    I need to call GetActivationFactory not ActivateInstance.

    • Marked as answer by Jesse Jiang Tuesday, August 28, 2012 9:19 AM
    Monday, August 27, 2012 2:27 PM

All replies

  • Ok i solved the problem myself:

    I need to call GetActivationFactory not ActivateInstance.

    • Marked as answer by Jesse Jiang Tuesday, August 28, 2012 9:19 AM
    Monday, August 27, 2012 2:27 PM

  • Thanks for sharing the solution.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, August 28, 2012 9:19 AM