void vmsFlashHelper::GetFlashMoviesList(IHTMLDocument2Ptr spDoc, std::vector <fsString> *pslURLs, std::vector <fsString> *pslHTMLs) { USES_CONVERSION; FLASHLIST vf; GetFlashMoviesObjList (spDoc, &vf, TRUE); IHTMLLocationPtr spLoc; spDoc->get_location (&spLoc); BSTR bstrHref = NULL; spLoc->get_href (&bstrHref); fsString strParent = W2A (bstrHref); SysFreeString (bstrHref); for (int i = 0; i < vf.size (); i++) { IDispatch* pTag = vf [i]; fsString strMovieURL; fsString strMovieHTML; IHTMLObjectElementPtr spObject (pTag); if (spObject != NULL) { IDispatchPtr spObj; spObject->get_object (&spObj); IShockwaveFlashPtr spFlash (spObj); if (spFlash != NULL) { BSTR bstr; spFlash->get_Movie (&bstr); strMovieURL = W2A (bstr); SysFreeString (bstr); } } else { IHTMLEmbedElementPtr spObject(pTag); BSTR bstrSrc = NULL; spObject->get_src(&bstrSrc); strMovieURL = W2A (bstrSrc); SysFreeString (bstrSrc); } if (pslHTMLs != NULL) { IHTMLElementPtr spElement (pTag); BSTR bstr = NULL; spElement->get_outerHTML (&bstr); strMovieHTML = W2A (bstr); SysFreeString (bstr); } pslURLs->push_back (strMovieURL); if (pslHTMLs) pslHTMLs->push_back (strMovieHTML); } }
void vmsFlashHelper::GetFlashInfo(IDispatchPtr spFlash, IHTMLDocument2Ptr spDoc, fsString *pstrMovieURL, fsString *pstrMovieHTML) { USES_CONVERSION; IHTMLLocationPtr spLoc; spDoc->get_location (&spLoc); BSTR bstrHref = NULL; spLoc->get_href (&bstrHref); fsString strParent = W2A (bstrHref); SysFreeString (bstrHref); IHTMLObjectElementPtr spObject (spFlash); if (spObject != NULL) { IDispatchPtr spObj; spObject->get_object (&spObj); IShockwaveFlashPtr spFlash (spObj); if (spFlash != NULL) { BSTR bstr; spFlash->get_Movie (&bstr); *pstrMovieURL = W2A (bstr); SysFreeString (bstr); } } else { IHTMLEmbedElementPtr spObject (spFlash); BSTR bstrSrc = NULL; spObject->get_src(&bstrSrc); *pstrMovieURL = W2A (bstrSrc); SysFreeString (bstrSrc); } if (pstrMovieHTML != NULL) { IHTMLElementPtr spElement (spFlash); BSTR bstr = NULL; spElement->get_outerHTML (&bstr); *pstrMovieHTML = W2A (bstr); SysFreeString (bstr); } }