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

84 lines
1.6 KiB
C++

// DWFFile.cpp : Implementation of CDWFFile
#include "stdafx.h"
#include "assert.h"
#include "DWFFile.h"
#include "myEPlotSection.h"
// CDWFFile
STDMETHODIMP CDWFFile::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* arr[] =
{
&IID_IDWFFile
};
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
//CDWFFile::~CDWFFile()
//{
// // It seems we never get here? Use FinalRelease
//};
HRESULT CDWFFile::FinalConstruct()
{
m_EPlotSections.SetParent(this);
m_EPlotSections.SetOuterUnknown(GetControllingUnknown());
return m_EPlotSections.FinalConstruct();
}
// Omdat de tellingen gekoppeld zijn weten we zeker dat de refcount van
// onze eigen objecten ook 0 zal zijn en is het dus veilig ze weg te gooien (toch...?)
void CDWFFile::FinalRelease()
{
m_EPlotSections.FinalRelease();
}
STDMETHODIMP CDWFFile::Open(BSTR DWFPath)
{
try
{
if (CDWFFileImpl::Open(CString(DWFPath)))
{
return S_OK;
}
else
return E_FAIL;
}
catch (CString& e)
{
return myAtlReportError (GetObjectCLSID(), e);
}
}
STDMETHODIMP CDWFFile::get_PropertiesXML(BSTR* pVal)
{
CString s;
if (CDWFFileImpl::get_PropertiesXML(s))
{
CComBSTR bstrString(s);
return bstrString.CopyTo(pVal);
}
else
return E_FAIL;
return S_OK;
}
STDMETHODIMP CDWFFile::get_EPlotSections(IEPlotSections **ppEPlotSections)
{
// if (!m_isOpen)
// return myAtlReportError (GetObjectCLSID(), "\nDWF File is not opened");
return m_EPlotSections.QueryInterface(ppEPlotSections);
}