cInfo.OutputString(_T("%sEnd collection"), szIndent);
void tstDrillerLevel(BrowserInfo &cInfo, IHTMLElementCollection *pCollection, int nLevel){	if (pCollection == NULL)	{		return;	}	LONG celem = 0;;	HRESULT hr = pCollection->get_length( &celem );	for ( int i=0; i< celem; i++ )	{		VARIANT varIndex;		varIndex.vt = VT_UINT;		varIndex.lVal = i;		VARIANT var2;		VariantInit( &var2 );		CIPtr(IDispatch) cpDisp; 		hr = pCollection->item( varIndex, var2, &cpDisp );		if ( hr != S_OK )		{			continue;		}		CIPtr(IHTMLElement) cpElem;		hr = cpDisp->QueryInterface( IID_IHTMLElement, (void **)&cpElem );		if ( hr == S_OK )		{			BSTR bstrTagName = NULL;			hr = cpElem->get_tagName(&bstrTagName);			CString szTagName = bstrTagName;			SysFreeString(bstrTagName);			BSTR bstrID = NULL;			hr = cpElem->get_id(&bstrID);			CString szID = bstrID;			SysFreeString(bstrID);			BSTR bstrClassName = NULL;			hr = cpElem->get_className(&bstrClassName);			CString szClassName = bstrClassName;			SysFreeString(bstrClassName);						USES_CONVERSION;			char szLevel[256];			memset(szLevel, 0, sizeof(szLevel));			memset(szLevel, ' ', nLevel);			cInfo.pfnOutputString(_T("%sElement %s"), A2T(szLevel), szTagName);			cInfo.pfnOutputString(_T("%s  id=%s"), A2T(szLevel), szID);			cInfo.pfnOutputString(_T("%s  classname=%s"), A2T(szLevel), szClassName);			CIPtr(IHTMLImgElement) cpImgElem;			hr = cpDisp->QueryInterface( IID_IHTMLImgElement, (void **)&cpImgElem );			if ( hr == S_OK )			{//				cpImgElem->get_href(&bstr);			}			else			{				CIPtr(IHTMLAnchorElement) cpAnchElem;				hr = cpDisp->QueryInterface( IID_IHTMLAnchorElement, (void **)&cpAnchElem );				if ( hr == S_OK )				{//					cpAnchElem->get_href(&bstr);				}			}			CIPtr(IDispatch) cpDispColl;			hr = cpElem->get_children(&cpDispColl);			if (hr == S_OK)			{				CIPtr(IHTMLElementCollection) cpColl = cpDispColl;				tstDrillerLevel(cInfo, cpColl, nLevel + 1);			}		}	}}