What are you doing exactly? If you need to capture those document events then you need to implement the event interface in FoxPro. To get a reference to the document object you need to pass in a reference either to the form or the document on the event object so it can see those instances.
It's not that easy, but here's what I do: I have an MSHTMLEventBase class that has properties on it for the document object and parent window. The event class
Inside the event you should be able to do:
DEFINE CLASS MSHtmlEventBase as RELATION
oDoc = null
DIMENSION aDocumentMap[1,1]
lShowDocumentMap = .F.
FUNCTION GetEventObject()
IF ISNULL(THIS.oDoc)
RETURN .NULL.
ENDIF
RETURN this.oDoc.ParentWindow.Event
ENDFUNC
ENDDEFINE
Then implement your event class as exported:
DEFINE CLASS IHtmlTextContainerEvents AS MSHTMLEventBase OLEPUBLIC
IMPLEMENTS HTMLTextContainerEvents IN "MSHTML.TLB"
...
ENDDEFINE
Then when you bind the event with BINDEVENTS you can explicitly assign the document object to the event handler so it can get a reference to the event object.
BINDEVENT(loBrowser.Document,loHtmlEventInterface)
loHtmlInterface.oDoc = loBrowser.Document
Then in the click handler (or any other event):
loEvent = this.GetEventObject()
? loEvent.keyCode
? loEvent.button
+++ Rick ---
>Rick,
>I know I must be missing something here. Since there is no click event or mouse down event in the browser control I was trying to trap for those using
HTMLDocumentEvents_onclick()
from your white paper. That was where the wait window error was coming from.
>
>So, how do I read a property and send it to my program when the user clicks on the browser control? I can have any number of browser controls on a form and I need to know which one they selected so I can set the HTML for that one.
>
>Thanks,
>John
>
>
>>The parent object should work. Just make sure you call it (and just about any other document properties) after the document has completed loading...
>>
>>+++ Rick ---
>>
>>>I have worked out almost all my problems with the blasted browser control. However I have a number of the controls within a number of different containers and when the user clicks on a browser control I can't find a way to determine which one was clicked on. The browser control just crashes with the code
WAIT WINDOW THIS.PARENT.NAME
. .Parent does not work.
>>>
>>>I found I can add the parent object as a property to the browser object. Now, how do I read it???