IEModule Events not firing

Add-in Express™ Support Service
That's what is more important than anything else

IEModule Events not firing
IEModule Events not firing 
5 States




Posts: 78
Joined: 2009-04-03
Okay, I was on a mission to figure out why the debug statements were not firing (which they still are not, but that's another issue), and i think I made some modification to my project that it now no longer fires events from IEModule.vb (like NavigateComplete2, DocumentComplete, etc.) I put MsgBoxes in all these Subs and the only one that fires are the ones in MsgBox in the "New()" Sub and in InitializeComponent().

Does anyone know what that is the only one that is firing? I really want to just get this to work.... Thanks in advance!


            Public Sub New()
                MyBase.New()
                MsgBox("in sub new")

                'This call is required by the Component Designer
                InitializeComponent()

                'This call initializes custom application
                'Call Kidira_Application_OnStartup(Nothing)
                MsgBox("end sub new")

            End Sub

            Public Sub New(ByVal container As System.ComponentModel.IContainer)
                MyBase.New(container)
                MsgBox("in sub new(container)")

                container.Add(Me)
                'This call is required by the Component Designer
                InitializeComponent()
                MsgBox("end sub new(container)")

            End Sub

            Public ReadOnly Property IEApp() As Interop.SHDocVw.WebBrowser
                Get
                    Return CType(Me.IEObj, Interop.SHDocVw.WebBrowser)
                End Get
            End Property

            Public ReadOnly Property HTMLDocument() As mshtml.HTMLDocument
                Get
                    Return CType(Me.HTMLDocumentObj, mshtml.HTMLDocument)
                End Get
            End Property

            Private Sub IEModule_BeforeNavigate2(ByVal e As ADXIEBeforeNavigate2EventArgs) Handles MyBase.BeforeNavigate2
                Try
                    MsgBox("in IEModule_BeforeNavigate2")

                    'Commented for debugging
                    Dim testVar = ""
                    MsgBox("test breakpoint")
                    MsgBox("test breakpoint")
                Catch ex As Exception
                End Try

            End Sub
Posted 07 Oct, 2011 16:13:34 Top
5 States




Posts: 78
Joined: 2009-04-03
UPDATE: Okay, this is weird, but I'm getting closer. I updated all the MsgBoxes in my IEModule.vb to "System.Diagnostics.Debug.WriteLine" and now I'm seeing more msgboxes that I had left in other Subroutines.

Not sure which MsgBox in which Handles was messing it up, but I'll let everyone know once I figure it out.

Does anyone know where i can see the System.Diagnostics.Debug.WriteLine output? It's not in the debug window.... unless they're not firing... Is it a local file?
Posted 07 Oct, 2011 16:40:24 Top
5 States




Posts: 78
Joined: 2009-04-03
UPDATE: In case this is happening to you - I have been developing this add-in using a different username on the server (who is in the Administrators group) - Unfortunately, there are still some things that "Administrator" username can do that my add'l username cannot. To ensure this was not the cause of some of these issues, I decided to log in to our server as the "Administrator" and use VS2005. I changed back all my System...WriteLines to MsgBox and I am still getting all the expected prompts.

Long Story Short: When developing on VS2005, ensure you are logged (preferably) as THE "Administrator" to ensure there are no security/access issues with files/libraries, etc. This may reduce your headaches and efforts.

Cheers!

Now onto my next nemesis: getting these breakpoints to trigger during debug....
Posted 07 Oct, 2011 18:04:48 Top
5 States




Posts: 78
Joined: 2009-04-03
UPDATE: I forgot to mention that when I logged in and ran VS2005 as "Administrator" that I had to go into IE Options and reset all Security settings to ensure that the ActiveX and other scripts would run. I think when I was debugging earlier, that user could not change the security settings on the browser, due to priveleges. Just another thing to check if this happens to you.
Posted 07 Oct, 2011 18:34:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hello.

Does anyone know where i can see the System.Diagnostics.Debug.WriteLine output?

You can use the DebugView tool. http://technet.microsoft.com/en-us/sysinternals/bb896647
Or just use the MessageBox.Show() method with the 'owner' parameter: MessageBox.Show(Me, "My Text")
Posted 10 Oct, 2011 03:53:06 Top