Click "Create New Document" Button:
Navigate to some URL:
Generally, there is a bitmap of company Logo as the background of MDI window. Sometimes, you may need a dynamic picture or more interactive ability. Here I will tell you how do it using TangranLite framework.
Config Background for MDI
You may download TangramLite first. After you setup, you can see "OS:\Program Files\TangramLite\debug" directory on your disk. There are samples we prepare for you.
Open "TangramLiteD.exe.config" file. This the config file for "TangramLiteD.exe", actually, this is XML format. You may see two nodes:
The first node specifies what type of background, here we want HTML. The second node specifies the filename of the HTML. But where is it located? You can find it here:
"OS:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background"
Now you can change it with your HTML page.
Interact with HTML
How can we interact with HTML? When we create a
CHTMLView and navigate to a special HTML file, the webbrowser gets
IDispatch interface of a COM object. Then we can write a script to invoke methods of the object through
IDispatch. COM object's method can call native code. Open "C:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background\Background.htm" in Notepad or other editor to see source. We can find the script:
That means when you click
Button1, it will invoke "
NewDocument" method of
theCOM object. We do an action in the method in fact. Open sample project "
TangramLiteMainFrameD", there, you can find an interface "
IApplication", it has a method "
TangramLiteMainFrameD". We do
NewDocument in the method implementation.
- 21st August, 2006: Initial post