Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exploring Internet Explorer with the VFP 7 Debugger
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Exploring Internet Explorer with the VFP 7 Debugger
Miscellaneous
Thread ID:
00654329
Message ID:
00654329
Views:
81
I'd like to use VFP 7.0 as a tool for examining instances of COM objects, i.e. ActiveX controls and OLE Automation objects, as easily as possible. My impression was that VFP7 makes it possible to directly inspect an instance of a complex object, like a WebBrowser control, simply by expanding a reference in a treeview-style Debugger Watch or Locals window. That's what I would like: to peruse the structure and properties of a live COM object in much the same way as native VFP objects.

This is what I thought I could get from VFP 7, but it isn't working nearly as well as I had hoped. Maybe I misunderstood and my expectations were too high, or maybe I haven't yet configured things to work as well as they should. I'm just getting my feet wet with VFP 7 (SP1), so I hope some of you veterans will please give me a little help.

I started with the following commands in the VFP Command Window:
x = CREATEOBJECT("InternetExplorer.Application")
x.Visible = .t.
x.navigate2('http://localhost/')
Going into the VFP Debugger, the Locals window now shows that x is an object and it has a member (i.e. a method) named "navigate2" with value = (none) and a "visible" property whose value = .T. I can see no other features of x in the Debugger at this point.

From the VFP Command window, I type a command line that begins with:
? VARTYPE(x.
Intellisense kicks in and presents me with a list of appropriate choices, from which I select "Document" and finish by entering this command line:
? VARTYPE(x.Document)
VFP displays the result "O", and the Debugger now reveals that x has a Document (Object), which I can expand to see a bunch of Document properties at once, along with their values. However, I still do not see any of the other properties of x (the IE WebBrowser), and I don't see all of the x.Document properties, only a subset of the "simple" ones. None of the object-type "properties" of x.Document are displayed in the Debugger, and some of the simple properties (e.g.charset) are not shown. Even if I type:
? VARTYPE(x.Document.charset)
VFP reports correctly that the type is "C", but this property still does not show up in the Debugger (that seems to be a bug). If I type a new command line that begins with:
? VARTYPE(x.Document.
Intellisense kicks in again, but the list of choices it gives me are properties and methods of the WebBrowser control, not of it's Document member object. (This would appear to be an Intellisense bug, but let's not focus on that point.) Now I try something else:
y = x.Document
? VARTYPE(y.
This makes some further progress, because Intellisense now correctly prompts me with a list of Document properties and methods, including those that were missing from the Debugger's display in the Locals window. In the Debugger, however, I still see nothing new (except y, which looks just like x.Document). I still don't get a peek at any of the additional properties that Intellisense knows are applicable to the Document object.

So, let's carry this just a little further with these command lines:
z = x.Document.body
? VARTYPE(z.
Again, Intellisense presents me with an appropriate, juicy list of of choices for properties and methods of the HTML Document Body object, which is nice, but the Debugger does not display anything about z, except that it's an (object), and I can't expand it. Furthermore, the Debugger does not show that x.document.body exists at all, only that there is now an object-type variable named z.

This is a mighty cumbersome way of perusing an instance of a WebBrowser control! I don't want to play a game of 20 questions. Am I missing something here, or is that all she wrote? If that's the best I can do with VFP 7, it sure is a major letdown from what I expected. Please tell me there's more to it than this!

TIA

Mike

P.S. Here are references to statements from Vlad, Dragan, and Ken that led me to expect more. Sorry if I misunderstood what you were saying about the VFP 7 Debugger.
Montage

"Free at last..."
Next
Reply
Map
View

Click here to load this message in the networking platform