New topic: using/converting VB6 data structures
<http://forums.realsoftware.com/viewtopic.php?t=47875> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message Carl4 Post subject: using/converting VB6 data structuresPosted: Tue May 14, 2013 8:50 am Joined: Sat Feb 09, 2013 7:41 pm Posts: 4 Hi, I am trying to figure out how (if?) I can use a database created in VB6 comprising records of structures. I plan to use RB's Binarystream functions and structure StringValue to access each record in a random fashion much as VB6 did. I defined the exact same structure format in an RB module and verified that the size and layout of the structure was the same as the original VB instance. Unfortunately, running the new RB program reports the database file is corrupt with an incorrect size. Am I missing something, or are the storage formats totally incompatible? Thanks, Carl. Top DaveS Post subject: Re: using/converting VB6 data structuresPosted: Tue May 14, 2013 9:15 am Joined: Sun Aug 05, 2007 10:46 am Posts: 4870 Location: San Diego, CA I suggest that you do NOT use Structures in RS the same way your used them in VB Convert things to CLASSES instead (yes that will mean other code will need to change too), but the result will be "better". RS Structures can have fixed length strings, but I do not believe that the format is the same as a string in a VB structure. _________________ Dave Sisemore iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top kermit Post subject: Re: using/converting VB6 data structuresPosted: Tue May 14, 2013 12:17 pm Joined: Mon May 30, 2011 12:56 am Posts: 690 Try a memoryblock in the first instance. If the structure is known to be 200 bytes, create a memoryblock of that size and read 200 byte chunks. Inperpreting the contents should be a bit easier from there. You can treat parts of the memoryblock as bytes, integers, and such like. Top timhare Post subject: Re: using/converting VB6 data structuresPosted: Tue May 14, 2013 9:28 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12317 Location: Portland, OR USA I would think that RB Structures would be the ideal solution here. The storage formats should be completely compatible. How are you determining the file is "corrupt"? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
