// StringsEnum.cpp : Implementation of CDevCon2App and DLL registration. #include "stdafx.h" #include "DevCon2.h" #include "StringsEnum.h" ///////////////////////////////////////////////////////////////////////////// // CStringsEnum::~CStringsEnum() { DWORD c; if(pMultiStrings) { for(c=0;c *pEnum = NULL; hr = CComObject::CreateInstance(&pEnum); if(FAILED(hr)) { return hr; } if(!pEnum) { return E_OUTOFMEMORY; } if(!pEnum->CopyStrings(pMultiStrings,Count)) { delete pEnum; return E_OUTOFMEMORY; } pEnum->Position = Position; pEnum->AddRef(); *ppEnum = pEnum; return S_OK; } BOOL CStringsEnum::CopyStrings(BSTR *pArray, DWORD NewCount) { DWORD c; if(pMultiStrings) { delete [] pMultiStrings; pMultiStrings = NULL; } Count = 0; Position = 0; pMultiStrings = new BSTR[NewCount]; if(!pMultiStrings) { return FALSE; } for(c=0;c