Save and Load Streams to WPTOOLS
Posted on 2010-09-20
I have what seems to me a very simple requirement.
I have been using WPTOOLS for a number of years to create HTML web content..
The problem for me is that if you use this component to save a Document as HTML and then Reload for editing later, it often messes up ESPECIALLY with tables.
So I had another idea, If you save the data in 2 formats. HTML for the web content only, and WPTOOLS own format so that when you re-load it there is no loss of formatting that happens with the HTML only version
Since MY data is all stored on a MySQL database I thought that it would be simple to do the following
1. Save the WPTOOLS data to a TMemoryStream
2. Save the TMemoryStream as a BLOB in the MySQL using MYDAC
3. Load the BLOB back as a Memory Stream using MYDAC
4. Load the Memory Stream back into WPTOOLS.
However No matter what options I try it simply doesnt work,
There does seem to always be data IN the MySQL BLOB field because it has a size of a few K, but when it comes to loading things back the WPTOOLS richedit is ALWAYS BLANK.
Rather than putting my clearly inadequate code on, maybe someone could suggest some fully working code