Title: Message
 
Now I need to create an application that can display a pre made Web - Page that will have some "Spaces" such as Edit Boxes, Selection Boxes ( drop down ) and buttons on it.  I need to be able to dynamically place text in to the edit boxes then display the web page from memory.  Then when someone select on of the buttons be able to pick up the text from the Edit Boxes and the selected item from the Selection Boxes.
This is not a difficult task.
In short I need to:
 
From my C++ app, place info in to a web page 
You need to manipulate the MSHTML DOM.  Specifically, you need to assign an ID attribute to the HTML fields you're interested in, and then from the C++ app, retrieve those elements using IHTMLDocument3::getElementById( ), and QueryInterface the returned pointer for the appropriate HTML Input element interface (say, IHTMLInputTextElement for text fields) and then call a method like IHTMLInputTextElement::put_value( ) to fill in the text field with the desired value.
Display it. 
You don't worry about this.  MSHTML and the WebBrowser control handle this one. 
Wait for a possible Button click (on the web page) although the app my need to do something else - display different pages.  
The C++ app should respond to the Button 
You have two options.  You can handle the onclick event of the button (I don't recommend this.)  You can also expose a COM object from your C++ code and let the WebBrowser control connect to it.  See my "Extending the WebBrowser Control DOM" article for detailed information.  This makes your HTML code as simple as:
 
 <button >My Text</button> 
Get the results from the Web page 
This is done using the same procedure I showed above, only using get_value( ) instead of put_value( ). 
Do something interesting. 

---------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[Email: [EMAIL PROTECTED]]
[WWW: http://www.beginthread.com/Ehsan ]

To these men of today will I not be light, nor be called light. Them- will I blind: lightning of my wisdom!
-Thus Spoke Zarathustra, F. W. Nietzsche

Reply via email to