UNSOLVED

midgley_richard

updated

17 years ago

0

3368

May 21st, 2009 22:00

1033 error on xstream dispose & maximum 32768 bytes in xstream

I am using VB.NET MS Visual Studio 2005. I downloaded the XAMSDK on 03 Feb 2009. Iget the errors when running the following code:

Dim

FileNo As Integer = FreeFile()

Dim

FileBytes() As Byte

FileOpen(FileNo, sFilePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)

ReDim FileBytes(LOF(FileNo) - 1)

FileGet(FileNo, FileBytes, 1)

FileClose(FileNo)

Dim xset As

XSet = xsys.CreateXSet

xset.CreateField(

"VME.Filename", sFile)

xset.CreateField(

"VME.ByteCount", FileBytes.Length)

Dim xs As XStream = xset.CreateXStream( "FileBody" , Constants.DEFAULT_MIME_TYPE)

Try

xs.Write(FileBytes, 0, FileBytes.Length)     <--- Fails here if FileBytes.Length is more than 32767

xs.Dispose()                                             <--- Fails here with error 1033

Dim xuid As

XUID = xset.Commit()

The XAM test harness demo code fails in exactly the same way. I have checked that my XSystem is Authenticad OK.

Does anyone have any ide what is going wrong.

Dick.