<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'How to import a binary file' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'How to import a binary file' posted on the 'C++ Builder' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 01:39:50 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 01:39:50 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>How to import a binary file</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/423562/423562/how-to-import-a-binary-file/</link>
      <description>Hi All,&lt;br /&gt;
&lt;br /&gt;
I am working on a project where i need to import a binary file into a RichEdit. I searched all over and i could not find any help about this.&lt;br /&gt;
&lt;br /&gt;
When i import the binary file, the most bytes are gone, it shows only the bytes that appeared to be ANSI code. so byte 0-32 are erased by RichEdit(i think)&lt;br /&gt;
&lt;br /&gt;
I tried to put plaintext on, but that wont fix the problem.&lt;br /&gt;
&lt;br /&gt;
Is there any way to import a complete binary file into RichEdit. It would be nice if the characters where shown as hex in stead of text.&lt;br /&gt;
&lt;br /&gt;
The code i am using:&lt;br /&gt;
RichEdit1-&amp;gt;Lines-&amp;gt;LoadFromFile(OpenDialog1-&amp;gt;FileName);&lt;br /&gt;
&lt;br /&gt;
Kind Regards,&lt;br /&gt;
&lt;br /&gt;
Midas&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/423562/423562/how-to-import-a-binary-file/</guid>
      <pubDate>Sat, 30 Apr 2011 22:56:33 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
    <item>
      <title>Re: How to import a binary file</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/423562/423682/re-how-to-import-a-binary-file/#423682</link>
      <description>here is the answer to my own question.just in case someone is looking for it:&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fstream.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
int main () {&lt;br /&gt;
  char * buffer;&lt;br /&gt;
  long size;&lt;br /&gt;
  ifstream file ("example.dat", ios::in|ios::binary|ios::ate);&lt;br /&gt;
  size = file.tellg();&lt;br /&gt;
  file.seekg (0, ios::beg);&lt;br /&gt;
  buffer = new char [size];&lt;br /&gt;
  file.read (buffer, size);&lt;br /&gt;
  file.close();&lt;br /&gt;
 &lt;br /&gt;
  cout &amp;lt;&amp;lt; "the complete file is in a buffer";&lt;br /&gt;
 &lt;br /&gt;
  delete[] buffer;&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Cheers!&lt;br /&gt;
&lt;br /&gt;
midas&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/423562/423682/re-how-to-import-a-binary-file/#423682</guid>
      <pubDate>Sat, 07 May 2011 12:59:20 -0700</pubDate>
      <category>C++ Builder</category>
    </item>
  </channel>
</rss>