Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

H Pham

@H Pham
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Implementation two interfaces in one class
    H H Pham

    The issue might lie in this statement: *ppv = this; Because you use a C-cast to type void*, type information is lost. The pointer does not point to the correct virtual table of the interface that you want to return. Try the following instead:

    STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
    {
    HRESULT hr;
    if (IID_ICredentialProviderSetUserArray == riid)
    {
    *ppv = dynamic_cast<ICredentialProviderSetUserArray>( this );
    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
    hr = S_OK;
    }
    else if (IID_IUnknown == riid ||
    IID_ICredentialProvider == riid )
    {
    *ppv = dynamic_cast<ICredentialProvider>( this );
    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
    hr = S_OK;
    }
    else
    {
    *ppv = NULL;
    hr = E_NOINTERFACE;
    }
    return hr;
    }

    COM help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups