Click here to Skip to main content
15,887,596 members
Home / Discussions / COM
   

COM

 
SuggestionRe: win32 dialogbox with custom control not displaying in windows 8 64bit Pin
Richard MacCutchan25-Jun-13 23:23
mveRichard MacCutchan25-Jun-13 23:23 
GeneralRe: win32 dialogbox with custom control not displaying in windows 8 64bit Pin
venkatesh5286726-Jun-13 0:43
venkatesh5286726-Jun-13 0:43 
GeneralRe: win32 dialogbox with custom control not displaying in windows 8 64bit Pin
Richard MacCutchan26-Jun-13 1:38
mveRichard MacCutchan26-Jun-13 1:38 
QuestionImplementation two interfaces in one class Pin
venkatesh5286718-Jun-13 20:47
venkatesh5286718-Jun-13 20:47 
AnswerRe: Implementation two interfaces in one class Pin
Richard MacCutchan18-Jun-13 23:05
mveRichard MacCutchan18-Jun-13 23:05 
GeneralRe: Implementation two interfaces in one class Pin
venkatesh5286719-Jun-13 1:11
venkatesh5286719-Jun-13 1:11 
GeneralRe: Implementation two interfaces in one class Pin
Richard MacCutchan19-Jun-13 2:21
mveRichard MacCutchan19-Jun-13 2:21 
GeneralRe: Implementation two interfaces in one class Pin
venkatesh5286719-Jun-13 2:30
venkatesh5286719-Jun-13 2:30 
Hi,

please check this code.i am highlighted with bold that code add then it is crashing.


#pragma once

#include <credentialprovider.h>
#include <windows.h>
#include <strsafe.h>

#include "PasswordResetCredential.h"
#include "helpers.h"

class CSampleProvider : public ICredentialProvider,public ICredentialProviderSetUserArray
{
public:
// IUnknown
STDMETHOD_(ULONG, AddRef)()
{
return _cRef++;
}

STDMETHOD_(ULONG, Release)()
{
LONG cRef = _cRef--;
if (!cRef)
{
delete this;
}
return cRef;
}

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

public:
IFACEMETHODIMP SetUsageScenario(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpus, DWORD dwFlags);
IFACEMETHODIMP SetSerialization(const CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION* pcpcs);

IFACEMETHODIMP Advise(__in ICredentialProviderEvents* pcpe, UINT_PTR upAdviseContext);
IFACEMETHODIMP UnAdvise();

IFACEMETHODIMP GetFieldDescriptorCount(__out DWORD* pdwCount);
IFACEMETHODIMP GetFieldDescriptorAt(DWORD dwIndex, __deref_out CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR** ppcpfd);

IFACEMETHODIMP GetCredentialCount(__out DWORD* pdwCount,
__out DWORD* pdwDefault,
__out BOOL* pbAutoLogonWithDefault);
IFACEMETHODIMP GetCredentialAt(DWORD dwIndex,
__out ICredentialProviderCredential** ppcpc);
IFACEMETHODIMP SetUserArray (__in ICredentialProviderUserArray * users);
friend HRESULT CSampleProvider_CreateInstance(REFIID riid, __deref_out void** ppv);

protected:
CSampleProvider();
__override ~CSampleProvider();

private:
void _CleanUpAllCredentials();

private:
LONG _cRef;
CSampleCredential **_rgpCredentials; // Pointers to the credentials which will be enumerated by this
// Provider.

ICredentialProvider *_pWrappedProvider; // Our wrapped provider.
DWORD _dwCredentialCount; // The number of credentials provided by our wrapped provider.
DWORD _dwWrappedDescriptorCount; // The number of fields on each tile of our wrapped provider's
// credentials.
bool _bEnumeratedSetSerialization;
ICredentialProviderUserArray* _pCredProviderUserArray;
};

modified 19-Jun-13 10:45am.

GeneralRe: Implementation two interfaces in one class Pin
Richard MacCutchan19-Jun-13 4:04
mveRichard MacCutchan19-Jun-13 4:04 
GeneralRe: Implementation two interfaces in one class Pin
Richard MacCutchan19-Jun-13 4:05
mveRichard MacCutchan19-Jun-13 4:05 
GeneralRe: Implementation two interfaces in one class Pin
venkatesh5286719-Jun-13 4:40
venkatesh5286719-Jun-13 4:40 
GeneralRe: Implementation two interfaces in one class Pin
Richard MacCutchan19-Jun-13 4:52
mveRichard MacCutchan19-Jun-13 4:52 
GeneralRe: Implementation two interfaces in one class Pin
ExcellentOrg6-Aug-13 23:05
ExcellentOrg6-Aug-13 23:05 
GeneralRe: Implementation two interfaces in one class Pin
Richard MacCutchan6-Aug-13 23:10
mveRichard MacCutchan6-Aug-13 23:10 
AnswerRe: Implementation two interfaces in one class Pin
H. Pham4-Sep-13 16:02
H. Pham4-Sep-13 16:02 
AnswerRe: Implementation two interfaces in one class Pin
DriveByCoder24-Mar-15 7:29
professionalDriveByCoder24-Mar-15 7:29 
QuestionSPECIAL CHARACTERS Pin
Hrpreet singh6-Jun-13 0:46
Hrpreet singh6-Jun-13 0:46 
QuestionImplement ILockBytes in C# (for I_IrmProtector) Pin
baloup16-May-13 2:40
baloup16-May-13 2:40 
Questionget all domains in ADSI forest Pin
venkatesh5286722-Apr-13 4:00
venkatesh5286722-Apr-13 4:00 
QuestionVoice call with Huawei USB Pin
tranduonghoan16-Apr-13 0:03
tranduonghoan16-Apr-13 0:03 
AnswerRe: Voice call with Huawei USB Pin
dusty_dex16-Apr-13 0:12
dusty_dex16-Apr-13 0:12 
QuestionMatlab COM Builder Pin
SergentX28-Mar-13 7:13
SergentX28-Mar-13 7:13 
QuestionCould not load file or assembly Interop.Microsoft.Office.Core Pin
Member 182181119-Mar-13 3:04
Member 182181119-Mar-13 3:04 
AnswerRe: Could not load file or assembly Interop.Microsoft.Office.Core Pin
Marco Bertschi19-Mar-13 3:56
protectorMarco Bertschi19-Mar-13 3:56 
GeneralRe: Could not load file or assembly Interop.Microsoft.Office.Core Pin
Member 182181119-Mar-13 5:30
Member 182181119-Mar-13 5:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.