[.NET] Probleme d'interface COM

nara20 Messages postés 6 Date d'inscription jeudi 20 janvier 2005 Statut Membre Dernière intervention 14 juin 2006 - 18 mars 2006 à 19:09
cs_epoc Messages postés 87 Date d'inscription mardi 28 mai 2002 Statut Membre Dernière intervention 25 octobre 2006 - 25 oct. 2006 à 14:00
Hello

J'ai un problème avec ce code :
J'ai une exception "System.InvalidCastException".

Quelqu'un peut m'expliquer pourquoi svp ?

Merci d'avance....

Nara

Message="Unable to cast COM object of type
'mshtml.HTMLInputElementClass' to interface type
'mshtml.IHTMLInputImage'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{3050F2C2-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following
error: Cette interface n'est pas prise en charge (Exception from
HRESULT: 0x80004002 (E_NOINTERFACE))."
Source="Microsoft.mshtml"

{
webBrowser1.Navigate("http://www.google.com");
while ((webBrowser1.IsBusy) || (webBrowser1.ReadyState !=
WebBrowserReadyState.Complete))
{ Application.DoEvents(); };

for (int j = 0; j <= webBrowser1.Document.All.Count - 1; j++)
{
object obj;
mshtml.IHTMLInputImage intf;
obj = webBrowser1.Document.All[j].DomElement;

if (obj is mshtml.IHTMLInputImage)
{

intf = (obj as mshtml.IHTMLInputImage);
Debug.Assert(intf!=null);

MessageBox.Show(intf.name); // <-- This throw an exception
}
}

}

2 réponses

mitsew Messages postés 4 Date d'inscription vendredi 31 janvier 2003 Statut Membre Dernière intervention 31 mars 2006
13 avril 2006 à 11:26
j'ai exactement le meme problème que toi et je me demande bien d'ou cela peut provenir si quelqu'un a une idée ?
0
cs_epoc Messages postés 87 Date d'inscription mardi 28 mai 2002 Statut Membre Dernière intervention 25 octobre 2006
25 oct. 2006 à 14:00
Même problème...
0
Rejoignez-nous