Modify

Opened 13 years ago

Closed 13 years ago

#1922 closed Bug (Wont Fix)

Shell.Explorer.2-Object and cancel Navigation with BeforeNavigate2 fails

Reported by: card0384@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

; Test script to embed an Shell.Explorer.2 (MS WebBrowser) control into an AutoIt GUI
;
; Reference for the BeforeNavigate2 event under: http://msdn.microsoft.com/en-us/library/aa768326(VS.85).aspx
;
; Error description:
; In order to have the full functionallity of the BeforeNavigate2 event it is needed to have the $IECancel paramter read and writeable. This parameter
; is documented as read and writeable but it is nowwhere documented how this is done in AutoIt. So I've tried to the ByRef keyword and this causes a
; crash of AutoIt. The Code below will reproduce this crash and when the ByRef keyword is removed then the code will work but there is still no possibillity
; to cancel the navigation.

#include <GUIConstants.au3> ; Begin of the main code
$oIE = ObjCreate ("Shell.Explorer.2") ; create Shell.Explorer.2 object
$GUI = GUICreate ("Embedded IE-Webbrowser", 830, 500, -1, -1 ) ; Create a simple GUI
GUISetState()
$GUIIE = GUICtrlCreateObj ($oIE, 1, 1 , 829 , 499) ; embed Shell.Explorer.2 object in GUI
$oIEEvents = ObjEvent ($oIE,"IEEvent","DWebBrowserEvents2") ; Assign events to functions starting with IEEvent
$oIE.navigate ("www.microsoft.com") ; navigate to www.microsoft.com
While $oIE.busy

Sleep (30) ; Idle around while site is loading

Wend

Sleep (5000) ; Sleep vor 5 seconds and then ...
Exit ; ... exit
; End of the main code

; Event: Will be called before a navigation starts
Func IEEventBeforeNavigate2 ($IEpDisp, $IEURL, $IEFlags, $IETargetFrameName, $IEPostData, $IEHeaders, ByRef $IECancel) ; Remove ByRef and it will work

$IECancel = True ; Dummy - Until I add other code

EndFunc

Attachments (0)

Change History (1)

comment:1 Changed 13 years ago by Jon

  • Resolution set to Wont Fix
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.