mshtml / interface / COM Generic Casting example
ever tried something like this: PrintAllElements< HTMLAnchorElement >(); and got all the elements where u have: public static bool IsTypeOf<T>( object o) { return (o is T); } private void PrintAllElements<T>() { HTMLDocument doc = webBrowser1.Document.DomDocument as HTMLDocument ; foreach ( IHTMLElement elem in doc.all) { if (IsTypeOf<T>(elem)) { //do stuff } } } i mean IsTypeOf always true? thats cuz all the HTML classes inherit the nice IHTMLElement so any IHTMLElement is T where T is HTMLxxxxxElemen...