Home > Software engineering >  MFC inserted inside the webbrowser control, the problem of web page fill out a form, for a great god
MFC inserted inside the webbrowser control, the problem of web page fill out a form, for a great god

Time:10-09

Want an edit box to a web page in word, but he couldn't get id and the name, only have the style of the access to the edit box the classname, and then found online version if you are in the Internet to some transferable IHTMLDocument7 - "getElementsByClassName (), so have the below idea,
Compilation can pass, but run collapse, I estimate is for this reason that
Consult a great god how to use this type, or give a MFC how to just know the classname of the edit box to the method

CodePudding user response:

In the baidu search relevant keywords,

CodePudding user response:

IHTMLElementCollection is an array of elements, you assign values to the spInputElement conversion failure, spInputElement null pointer, call put_value error,
You need to traverse the array, and find out what you want element,

Reference: https://msdn.microsoft.com/en-us/library/aa703928 (v=versus 85). Aspx

CodePudding user response:

The classname corresponding elements may have a number of,
At this point the returned is a collection of
You need to enumerate the set to get the element,
Using the length and the item properties for each element,
Also can use _newEnum to enumerate each element,
Each Element may be you need Element.
  • Related