C
Chris
Hi, I need to get the following VB6 code to work in .NET:
'/////
Dim doc As MSHTML.HTMLDocument
....
doc.getElementsByName("username").Item(0).Value = sn
doc.getElementsByName("password").Item(0).Value = pass
doc.getElementsByName("savepwd").Item(0).Checked = "yes"
'\\\\\
I got as far as the Item(0) part using C# and Microsoft.mshtml:
//////////////////////
HTMLDocumentClass doc = browser.Document as HTMLDocumentClass
HTMLElementCollectionClass elem =
doc.getElementsByName("username") as HTMLElementCollectionClass
object item = elem.item(0, 0);
// according to the MS documentation, item is now an IDispatch, but that
// interface exists in System.Windows.Forms.UnsafeNativeMethods, which
// is an internal class in mscorlib - not available for us to use.
//////////////////////
I'm not sure how I should proceed. Could I write a wrapper in C++ that
could use the IDispatch interface described in mshtml.h? If so, I haven't
the sleightest idea how, and google can't find anyone else who's tried this
(and succeeded).
Any help is appreciated.
Chris
'/////
Dim doc As MSHTML.HTMLDocument
....
doc.getElementsByName("username").Item(0).Value = sn
doc.getElementsByName("password").Item(0).Value = pass
doc.getElementsByName("savepwd").Item(0).Checked = "yes"
'\\\\\
I got as far as the Item(0) part using C# and Microsoft.mshtml:
//////////////////////
HTMLDocumentClass doc = browser.Document as HTMLDocumentClass
HTMLElementCollectionClass elem =
doc.getElementsByName("username") as HTMLElementCollectionClass
object item = elem.item(0, 0);
// according to the MS documentation, item is now an IDispatch, but that
// interface exists in System.Windows.Forms.UnsafeNativeMethods, which
// is an internal class in mscorlib - not available for us to use.
//////////////////////
I'm not sure how I should proceed. Could I write a wrapper in C++ that
could use the IDispatch interface described in mshtml.h? If so, I haven't
the sleightest idea how, and google can't find anyone else who's tried this
(and succeeded).
Any help is appreciated.
Chris