PDA

View Full Version : Loading TXW files over the internet


Unregistered
November 5, 2002, 14:54:21
I want to be able to load a TextControl File into a TextControl object on a web page.

I have seen all the examples but none of them show Text Control file loading.

The button click is:

Sub Button1_OnClick

Dim file

file = "note_temp.txw"

call Inet1.Execute("http://192.0.1.168/" & file, "GET")

If Inet1.ResponseCode <> 0 Then
MsgBox ("ErrorCode: " & Inet1.ResponseCode)
MsgBox ("Error: " & Inet1.ResponseInfo)
End If

End Sub

This works fine.

To catch the response, my code looks like this:

Sub Inet1_StateChanged(State)

Select Case State

Case 12
Dim strData: StrData = ""
Dim vtData
Dim bData

vtData = Inet1.GetChunk(10240, 1)

Do While LenB(vtData) <> 0

bData = bData & vtData

vtData = Inet1.GetChunk(10240, 1)

Loop

objTX.LoadFromMemory bData, 3, False

End Select

End Sub


I get a type mismatch error on this line "bData = bData & vtData",
and if I use icByteArray instead of 1, for the data type, I also get type mismatch errors.

Please can you help me, I am pulling my hair out here.

Chris Mitchell


This message was originally posted by Chris Mitchell in the old TX Text Control Support Forum.

Unregistered
November 6, 2002, 01:17:55
Hi Chris,

I had tp modify samples to make it work. Check my demo app at http://www.klarisoft.com/TX/Cab/txdemo1.htm

Leonid Chudakov


This message was originally posted by Leonid Chudakov in the old TX Text Control Support Forum.

Unregistered
November 6, 2002, 14:37:13
The getchunk method that you ae using is retreiving the data as a byte array. ie 1=icByteArray.

The concantenation of your values is being done as a variant, most probably with a sub type of String. A byteArray is not a string

Using LenB will always return a minimum value of 4, for the 4 bytes of memory used for the pointer to the byte array. Hence you would probably enter an endless loop, if the code did not bomb on the concantenation.

You could try using a cByte() on the concantenation

or Dim vtdata and bData as Byte ie

dim vtData() as byte
Dim bData() as byte

This would bring your data types into a common data tpe.


This message was originally posted by Matt in the old TX Text Control Support Forum.

Unregistered
November 7, 2002, 11:27:25
Thats great for loading thankyou.

What do you do when you want to save a TextControl file over the internet?

I have tried saving the document to memory, and then passing the variable to another web page, using PHP.
This didn't really return anything of any use.

Thanks


This message was originally posted by Chris Mitchell in the old TX Text Control Support Forum.

Unregistered
November 8, 2002, 15:29:22
Is FTP an option?

Inet1.Execute "FTP://ftp.microsoft.com", _
"PUT C:\Temp\Disclaimer.txt Disclaimer.txt "

Note File names that include embedded spaces are not supported.

> I have tried saving the document to memory, and then passing
> the variable to another web page, using PHP.
> This didn't really return anything of any use.

Are you saving to memory as ANSI or UNICODE?
I am only guessing but I think that the server would support and expect UNICODE.
The most probable reason for the information received in the PHP script being corrupt is a UNICODE/ANSI contlict of some sort. ie PHP Expects unicode and gets ANSI or visversa


This message was originally posted by Matt in the old TX Text Control Support Forum.

Webmaster
May 12, 2004, 16:11:41
Hello

To request a code signed CAB file, please fill in this brief form:

http://www.textcontrol.com/in/CabFileRequest.htm

Thank you

WebMaster