Development Of A New TX Text Control Web Site
Our current web site has served us well for the last two years, but as with all Internet related issues, it has aged very quickly. We therefore intend to send it into retirement in a few months. In the meantime, we have started work on the next version of the web site.
While we have many ideas about what should be online and how it should be structured, the web site is for you, the programmers who employ TX Text Control. Therefore, we would like to ask you for your ideas about what we should add to (or remove from) the new web site.
How can we support you better? How can we make the information that you need easier to find?
To enable an open discussion, we have started a thread in the discussion forum, where we would be delighted to read your ideas.
Another Interesting Way To Use TX Text Control In Internet Explorer
Using TX Text Control in Microsoft Internet Explorer only makes sense if you can actually load documents that lie on other computers - for example on a file server. Microsoft provides a control that makes this task very easy.
It's called MSInet.ocx and is available for download from http://www.microsoft.com if it's not already installed on your machine.
The following sample is written in plain HTML using VBScript.
Here is how it works:
<PARAM NAME="ViewMode" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="PageWidth" VALUE="12000">
<PARAM NAME="PageHeight" VALUE="16000">
<PARAM NAME="Text" VALUE="TX Text Control ActiveX in
In addition to the TX Text Control control, an Inet control is placed in the HTML code. It will not be visible later on, but we can use it to perform a variety of tasks. This example will only show how to download documents using HTTP, but FTP is possible as well.
Three buttons are also placed in the HTML file. Here are their event handlers:
strData = Inet1.OpenURL("http://www.example.com/down/msie_demo.txt", icString)
objTX.LoadFromMemory strData, 1, False
strData = Inet1.OpenURL("http://www.example.com/down/msie_demo.htm", icString)
objTX.LoadFromMemory strData, 4, False
Response = Inet1.Execute("http://www.example.com/down/msie_demo.rtf", "GET")
If Inet1.ResponseCode <> 0 Then
MsgBox ("ErrorCode: " & Inet1.ResponseCode)
MsgBox ("Error: " & Inet1.ResponseInfo)
In the first two handlers the Inet control's OpenURL method is used to download a file into a variable. This variable is then loaded into the TX Text Control using TX's LoadFromMemory method.
The third handler shows another way of loading a file. It uses the Inet Control's Execute method. The difference between the two methods is that the OpenURL method does not return until the file is downloaded. So, the application seems to hang. The execute method lets the Inet control send a message when data arrives. Here is the handler for this message:
Select Case State
' ... Other cases not shown.
Case 12 ' icResponseCompleted
Dim strData: StrData = ""
' Get first chunk.
vtData = Inet1.GetChunk(10240, icString)
Do While Len(vtData) <> 0
strData = strData & vtData
' Get next chunk.
vtData = Inet1.GetChunk(10240, icString)
objTX.LoadFromMemory strData, 5, False
The Inet control has 12 states. In this example only state no. 12 is of interest. When the control has reached this state, all data is downloaded. Using the GetChunk method, the data is stored in a variable and then loaded into TX Text Control with the LoadFromMemory method.
As soon as you try out this simple example, you will see that it is pretty easy to load documents from a server. Now it is up to your creativity to create an interesting distributed application. Why not let us know of your progress? We could even feature your code snippet in a later newsletter.
Notable Link Of The Week: Software Paradise
Founded in 1986 and trading online since early 1997, Software Paradise Is one of the U.K's premier mail-order and online resellers. Their catalog lists over 250,000 products including software, games and leisure titles, development tools, components, Electronic Software Download (ESD) titles, hardware, DVD movies, books and more. Take a look at what they have on offer:
The Newsletter Team