/
MadDAD
/
alterplast
Обзор
Документация
Войти
/
MadDAD
/
alterplast
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
vis1cpp/CoDefFiles.cpp
103 строки
2 KB
trdm
24 мар 2017, 12:42
24 мар 2017, 12:42
988c847
Код
Авторство
О чём код?
// CoDefFiles.cpp : Implementation of CCoDefFiles #include "stdafx.h" #include <functional> #include "Vis1cpp.h" #include "Vis1cpp_my.h" #include "CoDefFiles.h" ///////////////////////////////////////////////////////////////////////////// // CCoDefFiles CComImplPair<CCoDefFiles, IDefFiles, &IID_IDefFiles> CCoDefFiles::static_ComPair; CCoDefFiles::CCoDefFiles() { } CCoDefFiles::~CCoDefFiles() { } void CCoDefFiles::Init() { if (!static_ComPair){ if ( !static_ComPair.CreateInstance() ) MessageBox("%s - ������ ��������� ���������� %s", "CCoDefFiles::Init", "IID_IDefFiles"); } } void CCoDefFiles::Destroy() { Get()->RemoveAll(); static_ComPair.Release(); } STDMETHODIMP CCoDefFiles::get_Count(long *pVal) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) // TODO: Add your implementation code here *pVal = Count(); return S_OK; } STDMETHODIMP CCoDefFiles::get_Item(VARIANT varSrcIndexOrDefPath, IDefFile **pVal) { //AFX_MANAGE_STATE(AfxGetStaticModuleState()) // TODO: Add your implementation code here return GetItem(&varSrcIndexOrDefPath, pVal); } // ����� �������� � FOR EACH � Visual Basic STDMETHODIMP CCoDefFiles::get__NewEnum(LPUNKNOWN *pVal) { return GetNewEnum(pVal); } void CCoDefFiles::IfNeeded_FillAllElements() { if (IsEmpty()) FillAllElements(); } void CCoDefFiles::FillAllElements() { RemoveAll(); CDefFileInfo::ForEach( &CCoDefFiles::Static_AddEachElement ); //CDefFileInfo::ForEach( std::mem_fun_ref<void, CCoDefFiles, >( &CCoDefFiles::Add ); } // TODO ������������� ������ ����� Static_AddEachElement - � ������� mem_fun, bind � �.�. - ���� ���-�� �� ���������� void CCoDefFiles::Static_AddEachElement( const CDefFileInfo::CPtr& pClassInfo ) { Get()->Add(pClassInfo); } void CCoDefFiles::OnAdd( const CDefFileInfo::CPtr& pElem ) { } void CCoDefFiles::OnRemoveAll() { } STDMETHODIMP CCoDefFiles::FindByPath(VARIANT varSrcPath, IDefFile **pElem) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) // TODO: Add your implementation code here return FindItemByPath(varSrcPath, pElem); } CString CCoDefFiles::GetItemName( const CDefFileInfo::CPtr& pClassInfo ) { return pClassInfo->GetPath(); }