|
|
|
date: Thu, 23 Feb 2006 02:23:29 -0800,
group: microsoft.public.inetsdk.programming.html_objmodel
back
Re: META tag
Hi Igor,
I am always getting "failed at tags" from the below function.
Please correct me.
Code:
HRESULT CMyCls::HrGetMATATag(IHTMLDocument2 **pMSGHTML,BSTR &bstrMATA)
{
IHTMLElementCollection* pListOfElements = NULL;
HRESULT hr = NOERROR;
hr = (*pMSGHTML)->get_all(&pListOfElements);
FILE* FP = fopen("C:\\Tracefile.txt","a+");
if (SUCCEEDED(hr))
{
CComVariant varMATA("MATA");
IDispatch* pDispMATA = NULL;
hr = pListOfElements->tags(varMATA,&pDispMATA);
if (SUCCEEDED(hr))
{
IHTMLElement* pCONTENT = NULL;
hr = pDispMATA->QueryInterface(IID_IHTMLElement,(void**)&pCONTENT);
if (SUCCEEDED(hr))
{
BSTR bstrCHARSET;
hr = pCONTENT->get_innerText(&bstrCHARSET);
FILE* fp = fopen("C:\\chaset.txt","a+");
USES_CONVERSION;
fprintf(fp,"%s\n",W2A(bstrCHARSET));
fclose(fp);
if (FAILED(hr)) hr = E_FAIL;
SysFreeString(bstrCHARSET);
pCONTENT->Release();
}
else
fprintf(FP,"%s\n","failed at tags");
pDispMATA->Release();
}
else
fprintf(FP,"%s\n","failed at tags");
varMATA.Clear();
pListOfElements->Release();
}
else
fprintf(FP,"%s\n","failed at get_all");
fclose(FP);
return hr;
}
Thanks in advance.
Regards,
Durga.
"Igor Tandetnik" wrote:
> "Siri" wrote in message
> news:C678A626-8D00-4D8B-8D9F-3539DA7915C7@microsoft.com
> > How do I get directly META tag from IHTMLDocument2 interface?
>
> document.all.tags("meta")
>
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
date: Thu, 23 Feb 2006 05:53:30 -0800
author: Siri
|
|