Files
Slnkdwf/SlnkDWFCom/myEPlotSection.cpp
Jos Groot Lipman 80d0142c23 SLNKDWF 2.00
svn path=/Slnkdwf/trunk/; revision=12481
2007-08-01 13:42:28 +00:00

122 lines
2.5 KiB
C++

// EPlotSection.cpp : Implementation of CEPlotSection
#include "stdafx.h"
#include "myEPlotSection.h"
// CEPlotSection
STDMETHODIMP CEPlotSection::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* arr[] =
{
&IID_IEPlotSection
};
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
void CEPlotSection::InitImpl(CEPlotSectionImpl *epl)
{
m_pSectionImpl = epl;
}
void CEPlotSection::FinalRelease()
{
}
STDMETHODIMP CEPlotSection::get_Parent(IEPlotSections **ppParent)
{
return m_pParent->QueryInterface(IID_IEPlotSections, (void**)ppParent);
}
void CEPlotSection::SetParent(IEPlotSections *pParent)
{
m_pParent = pParent;
}
STDMETHODIMP CEPlotSection::get_Name(BSTR* pVal)
{
CComBSTR bstrString(m_pSectionImpl->get_Name());
return bstrString.CopyTo(pVal);
}
STDMETHODIMP CEPlotSection::get_Title(BSTR* pVal)
{
CComBSTR bstrString(m_pSectionImpl->get_Title());
return bstrString.CopyTo(pVal);
}
STDMETHODIMP CEPlotSection::get_PaperColor(ULONG* pVal)
{
(*pVal) = m_pSectionImpl->get_PaperColor();
return S_OK;
}
// Always inches
STDMETHODIMP CEPlotSection::get_PaperClipWidth(DOUBLE* pVal)
{
(*pVal) = m_pSectionImpl->get_PaperClipWidth();
return S_OK;
}
STDMETHODIMP CEPlotSection::Open(BOOL bForWrite)
{
try
{
m_pSectionImpl->Open( bForWrite);
return S_OK;
}
catch (CString &err)
{
return myAtlReportError (GetObjectCLSID(), err);
}
}
HRESULT CEPlotSection::Read( void *pv, ULONG cb, ULONG *pcbRead)
{
return m_pSectionImpl->Read( pv, cb, pcbRead);
};
HRESULT CEPlotSection::Write( const void *pv, ULONG cb, ULONG *pcbWritten)
{
return m_pSectionImpl->Write( pv, cb, pcbWritten) ;
};
STDMETHODIMP CEPlotSection::Close(void)
{
return m_pSectionImpl->Close();
}
STDMETHODIMP CEPlotSection::get_SourceDescription(BSTR* pVal)
{
CString s;
HRESULT res = m_pSectionImpl->get_SourceDescription(s);
(*pVal) = s.AllocSysString();
return res;
}
STDMETHODIMP CEPlotSection::get_PropertiesXML(BSTR* pVal)
{
CString s;
HRESULT res = m_pSectionImpl->get_PropertiesXML(s);
(*pVal) = s.AllocSysString();
return res;
}
STDMETHODIMP CEPlotSection::get_EPlotSectionImpl(/* CEPlotSectionImpl ** */ BYTE ** pVal)
{
(*pVal) = (BYTE *)m_pSectionImpl;
return S_OK;
}
STDMETHODIMP CEPlotSection::put_EPlotSectionImpl(/* CEPlotSectionImpl * */ BYTE * newVal)
{
return E_FAIL;
return S_OK;
}