Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PageFram.name screws up webbrowser.
Message
From
24/10/2003 14:56:42
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00840523
Message ID:
00842402
Views:
22
Hi David,
I've done the same thing and have no problems. I'm pretty sure that the olecontrol has some sort of conflict with containers. And PageFrames inside the same container that the olecontrol is in gets in the mix somehow also.

If the problem shows up again, I will change my class to type form instead of container. I just have some stuff in myForm_Base class that only work from scx files. So I feel kind of stuck with an scx file and AddObject( my_web_class_container )


I do have 2 questions about your code though.

1. What do the "doevents" in command1.click() accomplish? I know what doevents is for, I just don't see why you need them here.

2. Why do you "nodefault" in oie.refresh()






>Bill,
>
>>I do believe I finally found it. If I setfocus() to the webbrowser after resizing it, it works. The kicker though, is that focus has to be on another object when I oWeb.setfocus(). That's probably why my problem seemed to disappear and re-appear. I wasn't paying attention to where the focus was when I tested things. Now I check to see what the activecontrol is before oWeb.SetFocus() and it finally seems to be working.
>
>I have this little test IE form and it seems to behave absolutely correctly when focus is sitting in one of the VFP controls or on the browser. Although it doesn't run from the code below because the way the CB output the ADD OBJECT for the IE instance.
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>
> Top = 0
> Left = 0
> Height = 430
> Width = 807
> DoCreate = .T.
> Caption = "Form1"
> Name = "form1"
>
>
> ADD OBJECT txturl AS textbox WITH ;
> Height = 23, ;
> Left = 10, ;
> Top = 13, ;
> Width = 596, ;
> Name = "txtURL"
>
>
> ADD OBJECT command1 AS commandbutton WITH ;
> Top = 14, ;
> Left = 622, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Command1", ;
> Name = "Command1"
>
>
> ADD OBJECT oie AS olecontrol WITH ;
> Top = 52, ;
> Left = 13, ;
> Height = 368, ;
> Width = 785, ;
> Name = "oIE"
>
>
> PROCEDURE Init
> this.txtURL.Value = "www.microsoft.com"
> ENDPROC
>
>
> PROCEDURE Resize
> this.oIE.Width = this.Width - 2 * this.oIE.Left
> this.oIE.Height = this.Height - this.oIE.Top - 10
> ENDPROC
>
>
> PROCEDURE command1.Click
> thisform.oIE.Navigate( thisform.txtURL.Value )
>
> doevents
> do while thisform.oIE.Busy
> doevents
> enddo
>
> do while type( "thisform.oIE.Document" ) != "O"
> doevents
> enddo
>
> ENDPROC
>
>
> PROCEDURE oie.Refresh
> *** ActiveX Control Method ***
>
> nodefault
> ENDPROC
>ENDDEFINE
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform