Click here to Skip to main content
16,005,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVC.net to VC6.0 Pin
vibindia8-May-07 22:42
vibindia8-May-07 22:42 
AnswerRe: VC.net to VC6.0 Pin
Atul238-May-07 23:50
Atul238-May-07 23:50 
AnswerRe: VC.net to VC6.0 Pin
David Crow9-May-07 2:44
David Crow9-May-07 2:44 
AnswerRe: VC.net to VC6.0 Pin
ThatsAlok16-May-07 20:35
ThatsAlok16-May-07 20:35 
QuestionUrgent Converting stuff Pin
imanos8-May-07 22:15
imanos8-May-07 22:15 
AnswerRe: Urgent Converting stuff Pin
_AnsHUMAN_ 8-May-07 22:16
_AnsHUMAN_ 8-May-07 22:16 
AnswerRe: Urgent Converting stuff [modified] Pin
Sam_c8-May-07 22:40
Sam_c8-May-07 22:40 
AnswerRe: Urgent Converting stuff Pin
Nelek8-May-07 22:55
protectorNelek8-May-07 22:55 
Hi,

If you want to write it in a Text-File then you can use the answer above or another option.

CString szHex = "";
szHex.Format (_T("%x"), yourVariable); //With little Hexadecimal letters
szHex.Format (_T("%X"), yourVariable); //With capital hexadecimal letters

and then send it to the file as all other strings.



If you want to write it in a Binary-File, I used this in my project.

This from my view:
//Creation of the file, with overwriting if name matches
CFile f (pcFileName, CFile::modeCreate | CFile::modeWrite);
	
//Writing the PCode itself
obj.WriteHeader (&f);
dwActualPos = f.SeekToEnd ();


This from the CObject-derived where WriteHeader is:
void obj::WriteHeader (CFile* file)
{	Header[0] = 0x23957112
	Header[1] = 0x00001011;
	Header[2] = CalculateCodeLarge ();
	Header[3] = CalculateDataLarge ();
	Header[4] = CalculateNumberOfElements ();
	Header[5] = 0x00000000;
	Header[6] = (DWORD) GetInputsCount ();
	Header[7] = (DWORD) GetOutputsCount ();
	Header[8] = 0x00010000;

	DWORD* pHeadBuf;
	pHeadBuf = &Header[0];
	file->Write (pHeadBuf, sizeof (Header));

	return;
}


So you can send the hex directly.

--------
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?

AnswerRe: Urgent Converting stuff Pin
Vikrant for VC++9-May-07 1:28
Vikrant for VC++9-May-07 1:28 
QuestionDrag image on dialog box at run time Pin
rjkg8-May-07 22:12
rjkg8-May-07 22:12 
AnswerRe: Drag image on dialog box at run time Pin
_AnsHUMAN_ 8-May-07 22:15
_AnsHUMAN_ 8-May-07 22:15 
GeneralRe: Drag image on dialog box at run time Pin
rjkg8-May-07 22:53
rjkg8-May-07 22:53 
GeneralRe: Drag image on dialog box at run time Pin
_AnsHUMAN_ 9-May-07 0:20
_AnsHUMAN_ 9-May-07 0:20 
GeneralRe: Drag image on dialog box at run time Pin
rjkg9-May-07 1:10
rjkg9-May-07 1:10 
QuestionRe: Drag image on dialog box at run time Pin
Mark Salsbery9-May-07 5:05
Mark Salsbery9-May-07 5:05 
AnswerRe: Drag image on dialog box at run time Pin
rjkg9-May-07 19:27
rjkg9-May-07 19:27 
QuestionRe: Drag image on dialog box at run time Pin
Mark Salsbery10-May-07 5:17
Mark Salsbery10-May-07 5:17 
AnswerRe: Drag image on dialog box at run time Pin
rjkg10-May-07 19:40
rjkg10-May-07 19:40 
GeneralRe: Drag image on dialog box at run time Pin
Mark Salsbery11-May-07 4:42
Mark Salsbery11-May-07 4:42 
AnswerRe: Drag image on dialog box at run time Pin
Hamid_RT9-May-07 7:13
Hamid_RT9-May-07 7:13 
Questionuploading a file Pin
p_8-May-07 22:11
p_8-May-07 22:11 
AnswerRe: uploading a file Pin
_AnsHUMAN_ 8-May-07 22:13
_AnsHUMAN_ 8-May-07 22:13 
AnswerRe: uploading a file Pin
David Crow9-May-07 2:48
David Crow9-May-07 2:48 
AnswerRe: uploading a file Pin
ThatsAlok16-May-07 20:34
ThatsAlok16-May-07 20:34 
QuestionOne Istance of the application Pin
Kiran Pinjala8-May-07 21:53
Kiran Pinjala8-May-07 21:53 

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.