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, 21.06.2019 14:00
When designers make compromises during the engineering design process the result is often what?
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
You know the right answer?
CComPtr<IDISPATCH> spDisp; HRESULT hr = m_pWebBrowser2->get_Document(&am p;spDisp);
i...
Questions
question
Mathematics, 16.02.2021 23:20
question
Mathematics, 16.02.2021 23:20
question
Mathematics, 16.02.2021 23:20
question
Mathematics, 16.02.2021 23:20
question
Mathematics, 16.02.2021 23:20
Questions on the website: 13722361