sendMessage troubleshooting

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

sendMessage troubleshooting
 
George Stavrev




Posts: 17
Joined: 2011-06-30
Hi there,

I have the following scenario:
A user comes to my page, say page1.html. When that happens the Add-In detects its the right page and opens a new tab that goes to page2.html. I want to be able to send a message back to the first page1.html when page2.html is finished loading. Eventaualy I want to add some data and such, but for now a simple trigger will do. I create a project for IE and added 3 events, but it seems that the OnSendMessage never gets called. I added them by going to the Design View and double clicking on the property.

Any ideas? I looked at the advancedsearch project but was not able to see where I am going wrong. These are the 3 events. They DocumentComplete and DownloadComplete fire when I had the MessageBox.Show enabled.


       private void IEModule_DocumentComplete(object pDisp, string url)
        {
            //MessageBox.Show("DocumenteComplete");
            this.SendMessageToAll(0, IntPtr.Zero, IntPtr.Zero);
            this.SendMessage(0, IntPtr.Zero, IntPtr.Zero);
        }

        private void IEModule_DownloadComplete()
        {
           // MessageBox.Show("DownloadComplete");
            this.SendMessageToAll(0, IntPtr.Zero, IntPtr.Zero);
            this.SendMessage(0, IntPtr.Zero, IntPtr.Zero);
        }

        private void IEModule_OnSendMessage(ADXIESendMessageEventArgs e)
        {
            MessageBox.Show("hello all thee");
            //IE.IWebBrowser browser = IEApp as IE.IWebBrowser;
            //object flags = (0x1000);
            //browser.Navigate("http://google.com", ref flags);
        }


Thanks
Posted 18 Jul, 2011 20:45:04 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi George,

The message ID should be 0x0400 + [a numeric value].
Posted 19 Jul, 2011 07:15:07 Top