// 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); }