Advertisement

12.31.2007 at 10:25AM PST, ID: 23051040
[x]
Attachment Details

Need to access properties of a Frame in a document.

Asked by GHG-RCH in Internet and Delphi Programming, Hypertext Markup Language (HTML), Delphi Components

Tags: Microsoft, MSHTML_TLB, 1.2, Working on code to parse web pages. Trying to get at frames, Delphi, IE 7/7, n/a, IHTMLFrameBase is Interface. IHTMLFramesCollection2.Frames.Item(Index) returns OleVariant

I am working with M SHTML_TLB trying to access the properties of a frame using IHTMLFramesCollection2.Frames.Item(Index) which returns an OleVariant. I beleive that the properties of the frame are defined by the IHTMLFrameBase or DispHTMLIFrame objects. How can I map the OleVariant returned to an object implementing the correct interface.

Using code like CurrFrame := Frames.Item(Index) as IHTMLFrameBase does not compile.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Code fragment brought together from various methods to illustrate problem.
var
WebBrowser: TWebBrowser;
Frames:     IHTMLFramesCollection2;
CurrFrame:  IHTMLFrameBase;
 
CurrDoc := WebBrowser.Document as IHTMLDocument2;
Frames := CurrDoc.frames as IHTMLFramesCollection2;
for i := 1 to Frames.length -1 do
begin
   // The line below is the problem
   CurrFrame := Frames.Item(Index) as IHTMLFrameBase;
   //Similar code with IHTMLElementCollectios is of course OK
   //Want to do stuff like
 
end;
 
Keywords: Need to access properties of a Frame i…
 
Loading Advertisement...
 
[+][-]01.15.2008 at 06:32AM PST, ID: 20662842

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.15.2008 at 06:32AM PST, ID: 20662847

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.15.2008 at 01:24PM PST, ID: 20666825

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.15.2008 at 02:26PM PST, ID: 20667364

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Internet and Delphi Programming, Hypertext Markup Language (HTML), Delphi Components
Tags: Microsoft, MSHTML_TLB, 1.2, Working on code to parse web pages. Trying to get at frames, Delphi, IE 7/7, n/a, IHTMLFrameBase is Interface. IHTMLFramesCollection2.Frames.Item(Index) returns OleVariant
Sign Up Now!
Solution Provided By: EddieShipman
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.16.2008 at 12:48PM PST, ID: 20675927

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 12:52PM PST, ID: 20675976

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628