Categories

CODE
Visual C++ Programming
C++ (Non Visual C++ Issues)
Modern Windows Apps (Metro)
C++ and WinAPI
Managed C++ and C++/CLI
Visual C++ Bugs & Fixes
Graphics Programming
Multithreading
Network Programming
Driver Development
Visual Basic 6.0 Programming
Visual Basic .NET
Crystal Reports
C-Sharp Programming
Managed C++
Visual Basic .NET
ASP.NET
.NET Framework
ADO.NET
Windows Presentation Foundation (WPF) & XAML forum
Silverlight
.NET Installation and Configuration Issues
Java Programming
AJAX
Scripting - Client Side
Database
XML
Wireless/Mobile Development
Assembly
Scripting - Server Side (PHP, Perl, etc.)
Python
General Developer Topics
Project Planning, Design, and Management
Testers and Testing
Algorithms & Data Structures
General Discussion / Chit Chat
Announcements, Press Releases, & News
Feedback
Articles Suggestions
Testing Area
Programming Projects
C# Game(s) Project
Game Engine Project
C++ Coding Project
Project: Code War
Slow Chat: Talk with Microsoft Developer Teams
Slow Chat: Developing Multithreaded Applications
Slow Chat: C++0x
Slow Chat: Visual C++: Yesterday, Today, and Tomorrow
Directory Services
General Windows and DNA Programming
Windows OS Issues
Open Positions (Jobs)
Looking for Work
Visual Basic .NET FAQs
Visual Basic FAQs
CodeGuru Individual FAQs
CodeGuru Individual Visual Basic FAQs

Resources

Java Database
Linux
Coding
Mobile
Hardware
Software Development
Software Development
iOS,OS X
iOS,OS X
ORACLE
IBM DEVELOPER
IBM DEVELOPER
MSDN
MSDN


Tags

Visual C++ Programming

Ask questions about Windows programming with Visual C++ and help others by answering their questions.

InstallShield - Reading from a binary file


Second post!  Still need help!!   I'm trying to write a script in InstallShield that reads from a binary file. The binary file was written with the statements:   FILE *exerfile = fopen(Temp, "wb" );	 if (exerfile != NULL)	 {		 	for ( k=0; k<1000; k++)		 	{			 		fwrite(Exer_info[k].name,  sizeof(Exer_info[0].name), 1, exerfile); 		fwrite(&(Exer_info[k].id),  sizeof(Exer_info[0].id), 1, exerfile); 	}		 	fclose(exerfile);	 }      where Exer_info is an array of 1000, and each member of Exer_info contains:   char name[45]; int id;    When I try to read the file in my InstallShield script, I use the following statements in a while loop that iterates 1000 times.   ReadBytes (nvFileHandle, svTitle, 0, 45); ReadBytes (nvFileHandle, svID, 0, 4);   The variables in the above statement are declared as:  NUMBER nvFileHandle; STRING svTitle, svID;   I'm getting valid data for the svTitle variable, but svID is filled with garbage. I tried converting it to a number, but since the string contains garbage, the number becomes 0 -- it should be 1 the first time through the while loop.  If I comment out the second ReadBytes statement and replace it with  SeekBytes(nvFileHandle, 4, FILE_BIN_CUR); to move forward 4 bytes and skip reading the ID, I'm able to read all of the correct values into svTitle.  I need to figure out how to get those 4 bytes, which represent an integer, and the only function to read from a binary file that I can find in the InstallShield help is ReadBytes, which must read into a string!   Please help!  I've looked everywhere for the answer and can't find it.  I must read this file before I install a new version of my product on my customer's system.   Thanks! Stephanie


Related Links

How to change color of menu,dialog,button....
Call Costing Programme HELP!!
how can i call
Windows Explorer Plugin
Upgrading a big project to Visual Studio 8
Context menu missing for 64 bit.
Choosing which lines from file to read
what is the maximum number of bitmap resources?
no DLL_PROCESS_ATTACH in MFC dll
c# to c++ convertion help
c++ gui page flipping animation
Update Version Information (StringFileInfo)
Display bitmap and then SetDIBitsToDevice in PDA/Mobile...
CZoomView ScrollView Printing
Request ebook
Complex Matrix manipulation using Visual Studio 2005