Hi,
I have made an acivex control as safe by implemeting following 2 methods.
I am getting authentication window, while accessing this control in
internet
zone.
How to prevent this dialog. Please help me
HRESULT STDMETHODCALLTYPE
CTCSCADataSignerCtrl::XObjSafe::GetInterfaceSafetyOptions(
/* [in] */ REFIID riid,
/* [out] */ DWORD __RPC_FAR *pdwSup****tedOptions,
/* [out] */ DWORD __RPC_FAR *pdwEnabledOptions)
{
METHOD_PROLOGUE(CTCSCADataSignerCtrl, ObjSafe)
HRESULT retval = ResultFromScode(S_OK);
// does interface exist?
IUnknown FAR* punkInterface;
retval = pThis->ExternalQueryInterface(&riid,
(void * *)&punkInterface);
if (retval != E_NOINTERFACE) { // interface exists
punkInterface->Release(); // release it--just checking!
}
// we sup****t both kinds of safety and have always both set,
// regardless of interface
*pdwSup****tedOptions = *pdwEnabledOptions = dwSup****tedBits;
return retval; // E_NOINTERFACE if QI failed
}
HRESULT STDMETHODCALLTYPE
CTCSCADataSignerCtrl::XObjSafe::SetInterfaceSafetyOptions(
/* [in] */ REFIID riid,
/* [in] */ DWORD dwOptionSetMask,
/* [in] */ DWORD dwEnabledOptions)
{
METHOD_PROLOGUE(CTCSCADataSignerCtrl, ObjSafe)
// does interface exist?
IUnknown FAR* punkInterface;
pThis->ExternalQueryInterface(&riid, (void * *)&punkInterface);
if (punkInterface) { // interface exists
punkInterface->Release(); // release it--just checking!
}
else { // interface doesn't exist
return ResultFromScode(E_NOINTERFACE);
}
// can't set bits we don't sup****t
if (dwOptionSetMask & dwNotSup****tedBits) {
return ResultFromScode(E_FAIL);
}
// can't set bits we do sup****t to zero
dwEnabledOptions &= dwSup****tedBits;
// (we already know there are no extra bits in mask )
if ((dwOptionSetMask & dwEnabledOptions) !=
dwOptionSetMask) {
return ResultFromScode(E_FAIL);
}
// don't need to change anything since we're always safe
return ResultFromScode(S_OK);
}
thanx in advance
Param


|