⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iconfactory.cpp

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 CPP
字号:
////////////////////////////////////////////////////////////////////////////////
//  File : IconFactory.cpp
//
//  Copyright (C) 2002 PGP Corporation
//
//  ABSTRACT
//		Create IconFactory object.
// 
//  Author: Satya S. Das
//
////////////////////////////////////////////////////////////////////////////////

// include files 
#include "windows.h"
#include "gwc3po.h"
#include "IconFactory.h"
#include "util.h"
#include <crtdbg.h>
#include "pgpdebug.h"


// external data 
IUnknown * BuildIUnkDispatch(REFCLSID libid, REFCLSID iid, IUnknown *pIUnk, void *pIFac);
//extern HINSTANCE g_hInstance;


///////////////////////////////////////////////////////////////////
//  Name:IconFactory::IconFactory				
//
//  Description:IconFactory constructor 
//
//  In:none
//
//  Out:none
//
//  Comments:		
///////////////////////////////////////////////////////////////////
IconFactory::IconFactory(IUnknown *pUnk)
{
	PgpGwTrace("IconFactory::IconFactory\n");	
	m_pUnkOuter=pUnk;
	m_pIUnkDispFact=NULL;
}

///////////////////////////////////////////////////////////////////
//  Name:IconFactory::~IconFactory				
//
//  Description:IconFactory destructor	
//
//  In:none
//
//  Out:none
//
//  Comments:		
///////////////////////////////////////////////////////////////////
IconFactory::~IconFactory()
{
	PgpGwTrace("IconFactory::~IconFactory\n");	
	if(NULL != m_pIUnkDispFact)
	{
		m_pIUnkDispFact->Release();
		m_pIUnkDispFact=NULL;
	}
}

///////////////////////////////////////////////////////////////////
//  Name:IconFactory::QueryInterface				
//
//  Description:QueryInterface for IconFactory
//
//  In:REFIID riid -  Reference id
//
//  Out:LPVOID FAR* ppv - 
//
//  Comments:		
/////////////////////////////////////////////////////////////////////
STDMETHODIMP IconFactory::QueryInterface(REFIID riid, LPVOID FAR* ppv)
{
	PgpGwTrace("IconFactory::QueryInterface\n");	
	pgpAssert(NULL != ppv);
	if(NULL == ppv)
		return E_INVALIDARG;

   *ppv=NULL;


	if((IID_IEventMonitor == riid) || (IID_IUnknown == riid))
	{
		*ppv  = this;
		((LPUNKNOWN)*ppv)->AddRef();
		return S_OK;
	}

	if(IID_IDispatch == riid)
	{
		if (NULL == m_pIUnkDispFact)
		{
			m_pIUnkDispFact = BuildIUnkDispatch(LIBID_PgpGwTypeLibrary,
							IID_IIconFactory, (IUnknown *)(IIconFactory *)this,
							(void *)(IIconFactory *)this);
		}

		if (NULL != m_pIUnkDispFact)
			return m_pIUnkDispFact->QueryInterface(IID_IDispatch, ppv);
	}

	return E_NOINTERFACE;
}


/////////////////////////////////////////////////////////////////////
//  Name:       IconFactory::GetIcons
//
//  Description:  This interface is used to retrieve icons that
//                 represent the state of the C3po record types.
//
//  In:           ObjClass: string - String of the object class
//
//
//  Out:          pIconFile: string - Name of the file containing the icons(.dll or .exe)
//                 plUnOpenIcon: longint - Index value of the unopen icon
//                 plOpenIcon: longint - Index value of the open icon
//
//  Comments: The plUnOpenIcon and plOpenIcon parameters are icon index values within
//             the module (.exe or .dll) named by the pIconFile parameter.  Returning
//             a value of -1 indicates that a default icon should be used.  Any other
//             negative index value indicates a resource ID by taking the absolute value
//             of the number.  The IconFactory object does not support inheritance.
//             That is, there is no mechanism for two C3POs to both offer icons for
//             the same record.  The C3PO system will simply use the first C3PO it finds.
//
//             The icons retrieved are presumed to contain multiple image sizes.  The
//             appropriate size is used by GroupWise as needed.  The current C3PO
//             specification does not allow the C3PO to specify specific icon overlays (
//             such as the attachment clip).
///////////////////////////////////////////////////////////////
STDMETHODIMP IconFactory::GetIcons(THIS_ BSTR	bstrObjClass, 
			BSTR FAR *pbstrIconFile, long FAR *plUnOpenIcon, 
			long FAR *plOpenIcon)
{
	PgpGwTrace("IconFactory::GetIcons\n");	
	return S_OK;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -