Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 22, 2017 4:19 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: using/converting VB6 data structures
PostPosted: Tue May 14, 2013 8:50 am 
Offline

Joined: Sat Feb 09, 2013 7:41 pm
Posts: 5
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
 Profile  
Reply with quote  
 Post subject: Re: using/converting VB6 data structures
PostPosted: Tue May 14, 2013 9:15 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
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
 Profile  
Reply with quote  
 Post subject: Re: using/converting VB6 data structures
PostPosted: Tue May 14, 2013 12:17 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
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
 Profile  
Reply with quote  
 Post subject: Re: using/converting VB6 data structures
PostPosted: Tue May 14, 2013 9:28 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
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
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group