subject

CComPtr<IDISPATCH> spDisp; HRESULT hr = m_pWebBrowser2->get_Document(&am p;spDisp);
if (SUCCEEDED(hr) && spDisp)
{
// If this is not an HTML document (e. g., it's a Word doc or a PDF), don't sink.
CComQIPtr<IHTMLDOCUMENT2 &IID_IHTMLDocument2> spHTML(spDisp);
if (spHTML)
{
/*there can be frames in HTML page enumerate each of frameset or iframe
and find out if any of them contain a login page*/
EnumFrames(spHTML);
}
}

void CIeLoginHelper::EnumFrames(CComPtr& lt;IHTMLDocument2>& spDocument)
{

CComPtr<IIHTMLDocument2> spDocument2;
CComPtr<IIOleContainer> pContainer;
// Get the container
HRESULT hr = spDocument->QueryInterface(IID_I OleContainer,
(void**)&pContainer);

CComPtr<IIEnumUnknown>pEnumer ator;
// Get an enumerator for the frames
hr = pContainer->EnumObjects(OLECONTF _EMBEDDINGS, &pEnumerator);
IUnknown* pUnk;
ULONG uFetched;

// Enumerate and refresh all the frames
BOOL bFrameFound = FALSE;
for (UINT nIndex = 0;
S_OK == pEnumerator->Next(1, &pUnk, &uFetched);
nIndex++)
{
CComPtr<IIWebBrowser2> pBrowser;
hr = pUnk->QueryInterface(IID_IWebBro wser2,
(void**)&pBrowser);
pUnk->Release();
if (SUCCEEDED(hr))
{
CComPtr<IIDispatch> spDisp;
pBrowser->get_Document(&spDi sp);
CComQIPtr<IHTMLDocument2, &
IID_IHTMLDocument2> spDocument2(spDisp);
//Now recursivley browse through all of
//IHTMLWindow2 in a doc
RecurseWindows(spDocument2);
bFrameFound = TRUE;

}
}
if(!bFrameFound || !m_bFoungLoginPage)
{

CComPtr<IIHTMLElementCollection& gt; spFrmCol;
CComPtr<IIHTMLElementCollection& gt; spElmntCol;
/*multipe <FORM> object can be in a page,
connect to each one them
You never know which one contains uid and pwd fields
*/
hr = spDocument->get_forms(&spFrm Col);
// get element collection from page to check
if a page is a lgoin page
hr = spDocument->get_all(&spElmnt Col);
if(IsLoginPage(spElmntCol))
EnableEvents(spFrmCol);
}
}​

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Do you think media is stereotype ? and why?
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
You are to write a series of steps that anyone could follow to solve the following three problems: 1. even odd a. assume that someone tells you a number (an integer number) b. you hear the number and respond with the word even or odd 2. average a. assume that someone tells you between 3 and 5 numeric values. b. you hear the numbers and respond with the average is some number 3. dog or cat a. explain to a child the differences between a dog and a cat. b. your explanation could be used by a child or anyone to distinguish the difference between a dog and a cat
Answers: 1
You know the right answer?
CComPtr<IDISPATCH> spDisp; HRESULT hr = m_pWebBrowser2->get_Document(&am p;spDisp);
i...
Questions
question
Mathematics, 29.02.2020 23:18
question
History, 29.02.2020 23:18
question
Mathematics, 29.02.2020 23:18
question
Mathematics, 29.02.2020 23:19
Questions on the website: 13722367