Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading binary data into a linked list of charater arrays?

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
Well at the moment , doing ASCII files were fine, no prob at all what you got is an FTP-like server, and and FTP-like client, client get 256byte chunks when downloading from server, than I put those chunks into a linked list with a byte count(since the last one isnt always gona fill the whole 256bytes) problem is tho I tried a access Database, and when the FTP sends it over, and I have it write to a file from the linked list I have it stored in (for accuracy testing, I have it written to disk for file comparism) The original DB is 3 megs, from the linked list it was written as 730KB, I traced it seeing when copy the data received from the server, into the linked list, I get &quot;&quot; strings, which are written as zero number of characters, not 256 0 value, So how am I to store a binary file in memory. and succesfully write it.<br><br>( For those of you who may ask &quot;why do you want to do that&quot; This is a VC++ control , which will be placed into VB, the file request it makes is to be loaded into memory in the control then exported to VB by means of a safearray this way the application in a sense can Cache in memory what it retrieves )<br><br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Ok i made my own kind of string copy that put every single character right in where it belongs, then the writing of file showed up as the right number of megs, and it opened ok, and seemed fine, did a file comare in dos, did fine, cept when i did binary compare with the /B I found some differences not sure what it means<br><br>C:\WINDOWS&gt;fc C:\ldap.mdb C:\backu_\ldap.mdb<br>Comparing files C:\ldap.mdb and C:\backu_\ldap.mdb<br>FC: no differences encountered<br><br>C:\WINDOWS&gt;fc /B C:\ldap.mdb C:\backu_\ldap.mdb<br>Comparing files C:\ldap.mdb and C:\backu_\ldap.mdb<br>00000602: 99 98<br>00009385: AE D0<br>00009386: D9 08<br>00009387: 19 71<br>00009388: B8 BF<br>00009389: 2D 2C<br>000093AF: 03 02<br>003C2002: 18 1A<br>003C2008: 04 03<br>003C200E: 00 2A<br>003C200F: C8 04<br>003C2010: 2A 00<br>003C2011: 04 00<br>003C2078: 55 49<br>003C2079: 73 50<br>003C207A: 65 54<br>003C207B: 72 69<br>003C207C: 73 6D<br>003C207D: 00 65<br>003C207E: 00 72<br>003C20BD: 05 01<br>003C244E: 55 49<br>003C244F: 73 50<br>003C2450: 65 54<br>003C2451: 72 69<br>003C2452: 73 6D<br>003C2453: 00 65<br>003C2454: 00 72<br>003C2493: 05 01<br><br>C:\WINDOWS&gt;<br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
hmm tried it again, minor modifications, I guess I must have altered the DB somehow when i viewed it after downloading. (maybe access saves changes without you knowing) but any how it seems to be working. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top