Exemplo n.º 1
0
STDMETHODIMP DVConvertToPdf::Update()
{
	CResourceSwapper rs( _Module.m_hInstResource );
	
	CRightClick rightClick;
	if( rightClick.CanConvertToPDF() )
	{
		VARIANT saSelectedDocuments;
		VariantInit(&saSelectedDocuments);

		// Verify that the retrieval of the selected documents succeeded.
 		if( SUCCEEDED(GetSelectedObjects( &saSelectedDocuments )) )		
		{
			vector<WSDocNonCom> selectedDocuments;
			if( CDocCollector::PopulateSelectedDocuments(selectedDocuments,saSelectedDocuments) )
			{				
				if(rightClick.ShowConvertToPdf(selectedDocuments))
				{
					put_Status( nrActiveCommand );
					return S_OK;
				}
			}
		}
	}

	put_Status( nrGrayedCommand );
	return S_OK;
}
Exemplo n.º 2
0
HRESULT COpenPDFInWord::FinalConstruct()
{
	CResourceSwapper rs(_Module.m_hInstResource);
	CRightClick rightClick;
	
	put_Name(_bstr_t(_PROGID_GenericOpenPDFInWord));	

	m_sMenuText = rightClick.Get_OpenPdfInWord_MenuString();
	put_MenuText(_bstr_t(m_sMenuText.c_str()));
	put_Title(_bstr_t(m_sMenuText.c_str()));

	CStdString helpText;
	helpText.Format(_T("%s\n%s"), rightClick.Get_ConvertToPdf_HelperString(), m_sMenuText);
	m_sHelpText = helpText;
	put_HelpText(_bstr_t(m_sMenuText.c_str()));
			
	put_Type(nrStandardCommand);
	put_Status(nrGrayedCommand);
	
	m_hBitmap = ::LoadBitmap(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_PDFCOMBINE));
	_variant_t var = (long)m_hBitmap;
	m_Bitmap = var;
	
	return S_OK;
}
Exemplo n.º 3
0
void CBoxHttpResponse::Redirect(LPCTSTR pstrUrl)
{
	put_Status(_T("302 Object moved"));
	m_pAccept->AddHeader(_T("Location"), pstrUrl);
	Clear();
	End();
}
Exemplo n.º 4
0
HRESULT DVConvertToPdf::FinalConstruct( )
{
	CResourceSwapper rs( _Module.m_hInstResource );

	CRightClick rightClick;
	m_sMenuText = rightClick.Get_ConvertToPdf_MenuString();

	m_sHelpText = rightClick.Get_ConvertToPdf_HelperString();
	m_sHelpText += _T("\n");
	m_sHelpText += m_sMenuText;
	
	put_Name( _bstr_t( _PROGID_GenericConvertToPdf ) );	
	put_Title( _bstr_t( m_sMenuText.c_str() ) );
	put_Type( nrStandardCommand );
	put_Status( nrGrayedCommand );

	put_MenuText(_bstr_t( m_sMenuText.c_str() ));
	put_HelpText(_bstr_t(m_sMenuText.c_str()));

	m_hBitmap = ::LoadBitmap( _Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_CONVERTPDF) );
	_variant_t var = (long)m_hBitmap;
	m_Bitmap = var;
	
	return S_OK;
}
Exemplo n.º 5
0
CDVCompare::CDVCompare() : m_bSingleSelection(false)
{	
	ACHelper ach;

	CResourceSwapper rs( _Module.m_hInstResource );

	CRightClick rightClick;
	if(m_sMenuText.IsEmpty() )
	{
		m_sMenuText = rightClick.Get_CompareWithDeltaview_MenuString();
	}

	if(m_sHelpText.IsEmpty() )
	{
		m_sHelpText = rightClick.Get_CompareWithDeltaview_HelperString();
 		m_sHelpText += _T("\n");
		m_sHelpText += rightClick.Get_CompareWithDeltaview_MenuString();
	}
	
	put_Name( _bstr_t( _PROGID_GenericIManCompare ) );	
	put_Title( _bstr_t(m_sMenuText.c_str()) );

	if( IsOutlookInstalled() )
	{
 		put_Accelerator(MAKELONG(_T('D'), FALT | FVIRTKEY));
	}
	
	if(CanCompare())
	{
		put_Type(nrStandardCommand);
	}
	else
	{
		put_Type(nrSeparatorCommand); // Hide the compare menu item
		return;
	}
	put_Status( nrGrayedCommand );

	// The MenuText property identifies the command in a menu.  If an
	// accelerator is assigned to this menu, it should be indicated after a tab.
	if(false == m_sMenuText.empty())
	{
		put_MenuText(_bstr_t( m_sMenuText.c_str() ));
	}

    // The HelpText property should contain a status bar description of the
    // command, a newline, and then a ToolTip description of the command.
	put_HelpText(_bstr_t(m_sMenuText.c_str()));
	
    m_hBitmap = ::LoadBitmap(_Module.GetResourceInstance(), MAKEINTRESOURCE( IDB_DELTAVIEW));
	_variant_t var = (long)m_hBitmap;
    m_Bitmap = var;
}
Exemplo n.º 6
0
STDMETHODIMP CDVCompare::Update()
{
	ACHelper ach;

	CResourceSwapper rs( _Module.m_hInstResource );

	HRESULT	hr;
	VARIANT saSelectedDocuments;
	VariantInit(&saSelectedDocuments);
 	hr = GetContextValue( L"SelectedNRTDocuments", VT_DISPATCH|VT_ARRAY, &saSelectedDocuments );
	
	// Verify that the retrieval of the selected documents succeeded.
	if(SUCCEEDED(hr))
	{
		vector<WSDocNonCom> selectedDocuments;
		if(CDocCollector::PopulateSelectedDocuments(selectedDocuments,saSelectedDocuments))
		{
			CRightClick rightClick;
			if(rightClick.ShowCompareWithDeltaview(selectedDocuments))
			{
				put_Status( nrActiveCommand );			
			}
			else
			{
				put_Status( nrGrayedCommand );							
			}
		}	
		else
		{
			put_Status( nrGrayedCommand );							
		}	
	}
	else
	{
		put_Status( nrGrayedCommand );
	}
	
	return S_OK;
}
Exemplo n.º 7
0
STDMETHODIMP COpenPDFInWord::Update()
{
	CResourceSwapper rs(_Module.m_hInstResource);
	CRightClick rightClick;
	if(rightClick.CanOpenPdfInWord())
	{
		VARIANT saSelectedDocuments;
		VariantInit(&saSelectedDocuments);
		if(SUCCEEDED(GetSelectedObjects(&saSelectedDocuments)))		
		{
			vector<WSDocNonCom> selectedDocuments;
			if(CDocCollector::PopulateSelectedDocuments(selectedDocuments, saSelectedDocuments))
			{				
				if(rightClick.ShowOpenPdfInWord(selectedDocuments))
				{
					put_Status(nrActiveCommand);
					return S_OK;
				}
			}
		}
	}
	put_Status(nrGrayedCommand);
	return S_OK;
}