Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reading 'null' from binary files into char arrays/strings Pin
dfn9-May-07 9:53
dfn9-May-07 9:53 
GeneralRe: reading 'null' from binary files into char arrays/strings Pin
Chris Losinger9-May-07 10:18
professionalChris Losinger9-May-07 10:18 
GeneralRe: reading 'null' from binary files into char arrays/strings Pin
dfn9-May-07 10:41
dfn9-May-07 10:41 
QuestionRe: reading 'null' from binary files into char arrays/strings Pin
David Crow9-May-07 8:27
David Crow9-May-07 8:27 
AnswerRe: reading 'null' from binary files into char arrays/strings Pin
dfn9-May-07 9:54
dfn9-May-07 9:54 
AnswerRe: reading 'null' from binary files into char arrays/strings Pin
GameProfessor9-May-07 15:41
GameProfessor9-May-07 15:41 
GeneralRe: reading 'null' from binary files into char arrays/strings Pin
dfn10-May-07 5:23
dfn10-May-07 5:23 
AnswerRe: reading 'null' from binary files into char arrays/strings Pin
Nelek9-May-07 22:33
protectorNelek9-May-07 22:33 
Hi,

I have to read a binary file in my projecto too. And then use the values of the binary to complete the names of my elements. I put you a bit of my code, I hope it helps

UINT nObj = 0, nSub = 0;
BYTE byteData = 0x00;
BYTE* pDataBuf;

//For every object
for (nObj = 0; nObj < Header[6]; nObj++)
{	BYTE aReadSet [8] = {0};
	pDataBuf = &aReadSet[0];
	//For every subObject
	for (nSub = 0; nSub < pDoc->m_cmlObjSet[nObj].m_cmlSubSet.GetCount (); nSub ++)
	{	//Read the Data
		file->Read (pDataBuf, 8 * sizeof (BYTE));
		aReadSet[0] = *pDataBuf;
		CString szNameUnit = "";
		szNameUnit.Format (_T("%X"), aReadSet[0]);
		pDoc->m_cmlObjSet[nObj].m_cmlSubSet[nSub].m_szSubName = "SubObject"+szNameUnit;
		//Some Other operations with the other bytes in ReadArray
	}
	//More Code...
}


With that I read every block of data, use the first member of the array (binary ID) to differenciate/identify every element is being saved... The IDs may have values from 00 to FA, and ALL are readen and written correctly.

Ahm... I'm using VC++ 6

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

GeneralRe: reading 'null' from binary files into char arrays/strings Pin
dfn10-May-07 5:22
dfn10-May-07 5:22 
QuestionHow to launch a second application? Pin
IlanTal9-May-07 7:06
IlanTal9-May-07 7:06 
AnswerRe: How to launch a second application? Pin
led mike9-May-07 7:35
led mike9-May-07 7:35 
AnswerRe: How to launch a second application? Pin
Hamid_RT9-May-07 7:39
Hamid_RT9-May-07 7:39 
AnswerRe: How to launch a second application? Pin
David Crow9-May-07 8:10
David Crow9-May-07 8:10 
AnswerRe: How to launch a second application? Pin
SandipG 10-May-07 0:37
SandipG 10-May-07 0:37 
AnswerRe: How to launch a second application? Pin
IlanTal10-May-07 0:52
IlanTal10-May-07 0:52 
AnswerRe: How to launch a second application? Pin
#realJSOP10-May-07 2:06
professional#realJSOP10-May-07 2:06 
QuestionWYSIWYG Text Box Printing w/ Tabs Pin
GabeON9-May-07 6:05
GabeON9-May-07 6:05 
AnswerRe: WYSIWYG Text Box Printing w/ Tabs Pin
Mark Salsbery9-May-07 6:26
Mark Salsbery9-May-07 6:26 
GeneralRe: WYSIWYG Text Box Printing w/ Tabs Pin
GabeON9-May-07 9:42
GabeON9-May-07 9:42 
QuestionGDI - DC questions [modified] Pin
Nelek9-May-07 4:52
protectorNelek9-May-07 4:52 
AnswerRe: GDI - DC questions Pin
Hans Dietrich9-May-07 4:58
mentorHans Dietrich9-May-07 4:58 
AnswerRe: GDI - DC questions Pin
Mark Salsbery9-May-07 6:19
Mark Salsbery9-May-07 6:19 
AnswerThanks Pin
Nelek9-May-07 22:12
protectorNelek9-May-07 22:12 
QuestionService Host Pin
tom groezer9-May-07 3:52
tom groezer9-May-07 3:52 
AnswerRe: Service Host Pin
Mark Salsbery9-May-07 4:29
Mark Salsbery9-May-07 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.