J
J
John2017-11-30 17:01:11
C++ / C#
John, 2017-11-30 17:01:11

Why does an error occur when running GeckoFX + SocketIoClientDotNet?

1. I connect to the socket.io server on node js (everything goes. I need this to allow the server to run the form with the browser)
2. The GeckoFX browser loads and opens the page.
3. I need to know by the "message" event whether there is a block with a certain id on the page

{
             ................какой то код............
             socket.On("message",()=>Gerr(_webBrowser)); //пробовал и без передачи браузера
        }
        public void Gerr(GeckoWebBrowser wb)
        {
            var grr = wb.Document.GetElementById("idm"); //тут вылетает исключение
            .......................
        }

Throws an exception for some reason:
Unhandled exception of type 'System.InvalidCastException' in Geckofx-Winforms.dll
Additional information: Cannot cast COM object of type 'System.__ComObject' to interface type 'Gecko.nsIWebBrowser'. The operation failed because a call to QueryInterface on a COM component for interface with IID "{33E9D001-CAAB-4BA9-8961-54902F197202}" returned the following error: Interface not supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
And if I scroll the transition to another page:
wb.Navigate("https://yandex.ru");
Goes to the page without further ado.
Does anyone know why this thing is happening and how to defeat it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question