Sign in to follow this  
Followers 0

Dllstructgetdata Question

1 post in this topic

I am trying to read an old Database file made with BTreeFile (an extinct database manager library made with Turbo Pascal by TurboPower).

I'm using Larry's ApiFileReadWrite Functions and reading each record with a Structure defined with DllStructCreate() Function, in the Structure there are many String Fields that I defined as "char[xx]" in the string structure definition (ie "ubyte;char[40];char[8] " etc).

The problem is that when I'm trying to get a string field with DllStructGetData, this function return a string larger than the limit defined. (ie Field2 is "char[40]" it will return a string with length > 40).

The size of the string returned depends on the next byte equal to zero found.

So the questions are:

1) Is this the correct behaviour of DllStructGetData when reading a "char[xx]" field

2) If so, which is correct way to read strings from a binary file.

Thanks in Advance

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0