Google Answers Logo
View Question
 
Q: Using getAttribute function !!! ( No Answer,   0 Comments )
Question  
Subject: Using getAttribute function !!!
Category: Computers > Internet
Asked by: hareum-ga
List Price: $3.00
Posted: 06 May 2004 19:13 PDT
Expires: 06 May 2004 19:15 PDT
Question ID: 342436
I use the getAttribute function of IHTMLElement class.
I want MFC application get the attribute of the HTML file.
But the getAttribute function always get null value.
I show you the MFC code and HTML source.
Please help me.

// This is MFC code
void
CCyberChatDlg::OnChat()
{
	IHTMLDocument2* pCtrl=(IHTMLDocument2*)m_oMainDlg.m_pWebCtrl->GetHtmlDocument();
	IHTMLWindow2 *pWindow=(IHTMLWindow2*)NULL;
	pCtrl->get_parentWindow(&pWindow);
	IHTMLElement* pElement=(IHTMLElement*)NULL;
	pCtrl->get_body(&pElement);

	HRESULT hResult;
	VARIANT oAttr;
	hResult=pElement->getAttribute(L"strMSG.value", 1, &oAttr);
                                                  // oAttr always return 0 !!!
}

// HTML Source
<html>

<head>
</head>

<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" >
<INPUT name="strMSG" ID="strMSG" size="53" style="FONT-SIZE: 9pt;
COLOR: #333333; FONT-FAMILY: ??">

</body>
</html>
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy