04 May 2010

GeckoFx: Accessing the Document Elements

When using the GeckoFx version 1.9.1.0 browser control. it is important to use the correct version of the XULRunner.
When I tried to access the Document Elements with the 1.9.1.0 version of the XULRunner with this code:
geckoBrowser.Document.GetElementById("_mainTableDiv");
this is the error I encountered:
“Unable to cast COM object of type 'System.__ComObject' to interface type 
'Skybound.Gecko.nsIDOMNSElement'. This operation failed because the 
QueryInterface call on the COM component for the interface with 
IID '{F0AEF489-18C5-4DE6-99D5-58B3758B098C}' failed due to the following 
error: No such interface supported (Exception from HRESULT: 0x80004002 
(E_NOINTERFACE)).”

It was fixed by using the 1.9.1.4 version of the XULRunner.
Hope this helps someone.

4 comments:

  1. It helped me !

    ReplyDelete
  2. Thanks, that got 1 bug out of the way :)

    ReplyDelete
  3. I have 1.9.1.4 version of the XULRunner and the same problem "nable to cast COM object of type 'System.__ComObject...blablabla" :(

    ReplyDelete
  4. It worked for me too. Thanks!
    Now I have GeckoFX v1.9.1.0 and XULRunner v1.9.1.4 and it works fine!

    ReplyDelete