Results 1 to 1 of 1

Thread: SaveToMemory returns differrent data than was initially stored by LoadFromMemory

  1. #1
    Join Date
    May 2016
    Posts
    1

    SaveToMemory returns differrent data than was initially stored by LoadFromMemory

    This VB6 application loads an rtf into a textcontrol. The information on screen after the load appears to be a normal Bill of Lading template. When the user goes to another screen, the textcontrol is checked to see if anything has changed. Even though no changes were made by the user, the SaveToMemory returns different data. Since the field is bound to a recordset, an error is generated - "Multi-step operation generated errors. Check each status value."

    The following code snippet shows the problem I added the ba2 variable, and added a line of code in the section that loads the txc. The data stored by txc.LoadFromMemory is changed in the very next line txc.SaveToMemory. The two attached screen images from the VB6 watch window show that the data diverges after the first 32 bytes. The length of the initial rtf byte array was 10763 bytes and the length of returned ba2 array is 18271 bytes.

    I am developing on a Win 10 system and am running version 23 of the Activex TX TextControl.

    What am I missing? A solution is urgently needed.

    Dim ba() As Byte
    Dim ba2() As Byte
    Dim sData As String

    If eBindDirection = bdLoad Then
    sData = ToStr(fld.Value)
    'TX format
    If txcProperFormat(sData) Then
    ba = StrConv(sData, vbFromUnicode)
    txc.LoadFromMemory ba, 5, False
    ba2 = txc.SaveToMemory(5, False) <<<<<<<<<<<<<<<<< data returned in ba2 is not the same as ba in the previous line
    'Windows ANSI format
    Else
    txc.Text = sData
    End If
    txc.Refresh
    ElseIf eBindDirection = bdSave Then
    ba = txc.SaveToMemory(5, False)
    sData = StrConv(ba, vbUnicode)
    ToField fld, sData, bDataChanged
    End If
    txcBind = bDataChanged
    Exit Function
    Attachments Pending Approval Attachments Pending Approval

Similar Threads

  1. [OPEN] Extract Data Stored in TextFields as Batch Process.
    By anshu in forum TX Text Control .NET for Windows Forms
    Replies: 3
    Last Post: October 5, 2011, 11:24:21
  2. LoadFromMemory SaveToMemory
    By Major Dan in forum TX Text Control ActiveX
    Replies: 2
    Last Post: November 25, 2005, 03:37:50
  3. [SOLVED] SaveToMemory <--> LoadFromMemory
    By Unregistered in forum TX Text Control ActiveX
    Replies: 1
    Last Post: September 15, 2004, 09:40:39
  4. LoadFromMemory on MDI form returns error 380
    By kerim in forum TX Text Control ActiveX
    Replies: 0
    Last Post: July 9, 2004, 07:04:33
  5. LoadFromMemory() Beeps, returns TRUE, yet fails to load data
    By bitpusher1010 in forum TX Text Control ActiveX
    Replies: 2
    Last Post: May 19, 2003, 16:27:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •