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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading binary VB file in C++.Net 1

Status
Not open for further replies.

shetlandbob

Programmer
Mar 9, 2004
528
GB
Hi,

I'm reading a binary file which is created by VB6 and contains strings, long, double and integers.

Has anyone come across a problem of reading integers from VB6 binary created files?

I'm using the following format:

fread ( &Integer, sizeof(int), 1, inputResultsFile )

It reads in the strings and double etc correctly before it gets to the integers then it starts reading jiberish?

Has anyone come across a problem like this? Or have any idea what might be going on?

Any help much appreciated.

Thanks
 
Visual Basic (VB6) Integer == C++ short (2 bytes signed in VC++ 6.0)...
VC++ 6.0 int is 4-byte word (warning: may be another size by C++ Standard!)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top