Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CIcmUiFactory Class Reference

#include <shellext.h>

List of all members.

Public Member Functions

 CIcmUiFactory (REFCLSID rclsid)
 ~CIcmUiFactory ()
STDMETHODIMP QueryInterface (REFIID riid, void **ppvObject)
 STDMETHODIMP_ (ULONG) AddRef()
 STDMETHODIMP_ (ULONG) Release()
STDMETHODIMP CreateInstance (LPUNKNOWN punk, REFIID riid, void **ppvObject)
STDMETHODIMP LockServer (BOOL)

Static Public Member Functions

SCODE KeyToTheFactory (REFCLSID rclsid, REFIID riid, void **ppvObject)

Private Attributes

ULONG m_ulcReferences
UITYPE m_utThis


Constructor & Destructor Documentation

CIcmUiFactory::CIcmUiFactory REFCLSID  rclsid  ) 
 

Definition at line 214 of file shellext.cpp.

References CGlobals::Attach(), CIcmUiFactory(), IsMonitor, IsPrinter, IsProfile, IsScanner, m_ulcReferences, and m_utThis.

Referenced by CIcmUiFactory().

00214 { 00215 m_ulcReferences = 0; 00216 CGlobals::Attach(); 00217 if (IsEqualIID(rclsid, CLSID_ICM)) 00218 m_utThis = IsProfile; 00219 else if (IsEqualIID(rclsid, CLSID_PRINTERUI)) 00220 m_utThis = IsPrinter; 00221 else if (IsEqualIID(rclsid, CLSID_SCANNERUI)) 00222 m_utThis = IsScanner; 00223 else 00224 m_utThis = IsMonitor; 00225 }

CIcmUiFactory::~CIcmUiFactory  )  [inline]
 

Definition at line 76 of file shellext.h.

References CGlobals::Detach().

00076 { CGlobals::Detach(); }


Member Function Documentation

STDMETHODIMP CIcmUiFactory::CreateInstance LPUNKNOWN  punk,
REFIID  riid,
void **  ppvObject
 

Definition at line 242 of file shellext.cpp.

References CreateInstance(), m_utThis, NULL, and QueryInterface().

Referenced by CreateInstance().

00243 { 00244 00245 *ppvInstance = NULL; 00246 00247 if (punk) // We don't allow aggregation 00248 return CLASS_E_NOAGGREGATION; 00249 00250 // We simply create a new ICM UI object, and return an interface to it. 00251 // This will get queried by the shell for IExtShellInit, and the init job 00252 // will be done. 00253 00254 CICMUserInterface *pcicmui = new CICMUserInterface(m_utThis); 00255 00256 if (!pcicmui) 00257 return E_OUTOFMEMORY; 00258 00259 // Let's be paranoid- if the QueryInterface failes, kill the ICMUI object, 00260 // so we can still be unloaded! 00261 00262 HRESULT hrReturn = pcicmui -> QueryInterface(riid, ppvInstance); 00263 00264 if (!*ppvInstance) 00265 delete pcicmui; 00266 00267 return hrReturn; 00268 }

HRESULT CIcmUiFactory::KeyToTheFactory REFCLSID  rclsid,
REFIID  riid,
void **  ppvObject
[static]
 

Definition at line 276 of file shellext.cpp.

References KeyToTheFactory(), NULL, and QueryInterface().

Referenced by KeyToTheFactory().

00277 { 00278 00279 *ppvObject = NULL; 00280 00281 if (!IsEqualIID(rclsid, CLSID_ICM) && 00282 !IsEqualIID(rclsid, CLSID_MONITORUI) && 00283 !IsEqualIID(rclsid, CLSID_SCANNERUI) && 00284 !IsEqualIID(rclsid, CLSID_PRINTERUI)) 00285 return CLASS_E_CLASSNOTAVAILABLE; 00286 00287 CIcmUiFactory *pciuf = new CIcmUiFactory(rclsid); 00288 00289 if (!pciuf) 00290 return E_OUTOFMEMORY; 00291 00292 HRESULT hrReturn = pciuf -> QueryInterface(riid, ppvObject); 00293 00294 if (!*ppvObject) 00295 delete pciuf; 00296 00297 return hrReturn; 00298 }

STDMETHODIMP CIcmUiFactory::LockServer BOOL   )  [inline]
 

Definition at line 92 of file shellext.h.

References BOOL, and LockServer().

Referenced by LockServer().

00092 { return NOERROR; }

STDMETHODIMP CIcmUiFactory::QueryInterface REFIID  riid,
void **  ppvObject
 

Definition at line 227 of file shellext.cpp.

References NULL, and QueryInterface().

Referenced by CreateInstance(), KeyToTheFactory(), and QueryInterface().

00227 { 00228 00229 if (IsEqualIID(riid, IID_IUnknown) || 00230 IsEqualIID(riid, IID_IClassFactory)) { 00231 *ppvObject = this; 00232 AddRef(); 00233 return NOERROR; 00234 } 00235 // Asked for an interface we ain't got! 00236 *ppvObject = NULL; 00237 return E_NOINTERFACE; 00238 }

CIcmUiFactory::STDMETHODIMP_ ULONG   )  [inline]
 

Definition at line 81 of file shellext.h.

References L, m_ulcReferences, and STDMETHODIMP_().

00081 { 00082 if (--m_ulcReferences) 00083 return m_ulcReferences; 00084 00085 delete this; 00086 return 0L; 00087 }

CIcmUiFactory::STDMETHODIMP_ ULONG   )  [inline]
 

Definition at line 80 of file shellext.h.

References m_ulcReferences, and STDMETHODIMP_().

Referenced by STDMETHODIMP_().

00080 { return ++m_ulcReferences; }


Member Data Documentation

ULONG CIcmUiFactory::m_ulcReferences [private]
 

Definition at line 71 of file shellext.h.

Referenced by CIcmUiFactory(), and STDMETHODIMP_().

UITYPE CIcmUiFactory::m_utThis [private]
 

Definition at line 72 of file shellext.h.

Referenced by CIcmUiFactory(), and CreateInstance().


The documentation for this class was generated from the following files:
Generated on Sat May 15 19:46:27 2004 for test by doxygen 1.3.7