LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

IHTMLFramesCollection2

hi,

i know i am replying to this thread after a long time.. but i am having the same problem with frames in CVI.

1.I used IE activeX.

2. i got document IUnknown interface pointer from the ie Handle.

SHDocVw_GetProperty (ieHandle, 0, SHDocVw_IWebBrowser2Document, CAVT_UNKNOWN, &pUnk);

3.i got the document object from interface pointer

status=pUnk->lpVtbl->QueryInterface (pUnk,&IID_IHTMLDocument2, (void *)&document);

4.i got frames collection after that.

document->lpVtbl->get_frames(document,&pElem);  

5. i was able to get the no of frames after that

     pElem->lpVtbl->get_length(pElem,&leng);  

6.I got the document object for the IHTMLWindow2

    VARIANT ci,cl;

    IHTMLWindow2 pWindow;

     ci.n1.n2.vt=VT_UINT;
     ci.n1.n2.n3.lVal=frameindex;//int frame index;
     pElem->lpVtbl->item(pElem,&ci,&cl);
    status=cl.n1.n2.n3.pdispVal->lpVtbl->QueryInterface(cl.n1.n2.n3.pdispVal,&IID_IHTMLWindow2,(LPVOID*)&pWindow);
    status=pWindow->lpVtbl->get_document(pWindow,(void *)&document1);

After this step, i tried to iterate throug the frames.i success fully went through the first frame which is 'MAIN'

but i was not able to get the document object for the second frame.i am getting the same document object again and again.

i dont get what i am doing wrong.

regards,

Radha R

0 Kudos
Message 1 of 2
(3,515 Views)
Duplicate post. I posted an answer to this question here.
Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 2
(3,503 Views)