Solved

Using stream I/O in Doc/View model

Posted on 1998-05-18
2
190 Views
Last Modified: 2013-12-26
I have run into problem using TOutStream/TInStream classes in my OWL application. These stream classes derived from ostream/istream classes. This means that it write/read data in text format! How can I save data in real binary format (not only my own classes, but other OWL and BCPP classes, TPoint, for example)?
0
Comment
Question by:airat
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
msmits earned 50 total points
ID: 1299674
You could just try opening the stream in binary mode and writing the class you want on the output to the stream.
The problem with this is that some of the classes have internal pointers to other objects and possibly C strings (char *), which will then not be stored in your file.

If you really want such functionality, I suggest you create a derived class for each class you want streamable and provide extra functions to read and write the important information from and to file.
I believe C++Builder VCL classes are all streamable. At least they are all derived from a class with the substring streamable in the classname.
0
 
LVL 3

Expert Comment

by:msmits
ID: 1299675
Could you delete the other question that I didn't answer. It is identical to this one and will only cost you points.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now