Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: call a function from another class Pin
Albert Holguin2-Apr-11 18:20
professionalAlbert Holguin2-Apr-11 18:20 
AnswerRe: call a function from another class Pin
David Crow3-Apr-11 13:56
David Crow3-Apr-11 13:56 
GeneralRe: call a function from another class Pin
dat198877-Apr-11 1:40
dat198877-Apr-11 1:40 
QuestionGit: Inserting a commit below root? Pin
FocusedWolf2-Apr-11 9:05
FocusedWolf2-Apr-11 9:05 
AnswerRe: Git: Inserting a commit below root? Pin
«_Superman_»2-Apr-11 17:30
professional«_Superman_»2-Apr-11 17:30 
QuestionUsing WebBrowser Control in mfc application,Cpu usage is 50%. Pin
DesmondJiang1-Apr-11 21:48
DesmondJiang1-Apr-11 21:48 
QuestionRe: Using WebBrowser Control in mfc application,Cpu usage is 50%. Pin
Niklas L2-Apr-11 5:39
Niklas L2-Apr-11 5:39 
Questiona weird behavior Pin
Krauze31-Mar-11 22:17
Krauze31-Mar-11 22:17 
I've got the following file header structure with every field ending by '\0':
struct CF_HEADER
{
	TCHAR strIdentifier[7]; // "XXXXXX"
	TCHAR bHasPath[2];
	TCHAR bOrder[2];
	TCHAR nTime[4];		
	TCHAR nEffect[2];	
	TCHAR nNum[3];		
	TCHAR nPos[3];		
};

Then I initialized a UNICODE .txt file with this header. And in the file the following can be seen by Notepad:
XXXXXX 0 0 000 0 00 00

Of course there're times when these data should be updated. One of these functions to update the bOrder field is like this:
CF_HEADER m_cfhdInfo;
CFile file;
... // some other functions and reading the header into m_cfhdInfo
void SetOrder(BOOL bOrder)
{
	_itot_s(bOrder, &m_cfhdInfo.bOrder[0], sizeof(TCHAR), 10);

	updateHeader();
}
void updateHeader()
{
	file.Seek(2, CFile::begin);	// never overwrites 0xFEFF
	file.Write(&m_cfhdInfo, sizeof(CF_HEADER));
}

When I called SetOrder(TRUE), things proved weird. The following data can be seen in the file by Notepad:
XXXXXX 01  000 0 00 00

However, I had expected the results like this:
XXXXXX 0 1 000 0 00 00

Anyone could help? Thanks in advance.
QuestionRe: a weird behavior Pin
CPallini1-Apr-11 0:26
mveCPallini1-Apr-11 0:26 
AnswerRe: a weird behavior Pin
Krauze1-Apr-11 0:37
Krauze1-Apr-11 0:37 
QuestionRe: a weird behavior Pin
CPallini1-Apr-11 2:05
mveCPallini1-Apr-11 2:05 
AnswerRe: a weird behavior [modified] Pin
Stefan_Lang1-Apr-11 3:08
Stefan_Lang1-Apr-11 3:08 
QuestionHow to determine the control under cursor Pin
Arrin31-Mar-11 20:47
Arrin31-Mar-11 20:47 
AnswerRe: How to determine the control under cursor Pin
CodyDaemon31-Mar-11 21:44
CodyDaemon31-Mar-11 21:44 
GeneralRe: How to determine the control under cursor Pin
Arrin31-Mar-11 22:51
Arrin31-Mar-11 22:51 
GeneralRe: How to determine the control under cursor Pin
Damir Valiulin1-Apr-11 4:41
Damir Valiulin1-Apr-11 4:41 
AnswerRe: How to determine the control under cursor Pin
Arrin7-Apr-11 4:18
Arrin7-Apr-11 4:18 
AnswerRe: How to determine the control under cursor Pin
Arrin7-Apr-11 4:19
Arrin7-Apr-11 4:19 
QuestionExtract text(English & Chinese) from pdf [modified] Pin
wonderway31-Mar-11 16:47
wonderway31-Mar-11 16:47 
AnswerRe: Extract text(English & Chinese) from pdf Pin
Peter_in_278031-Mar-11 17:28
professionalPeter_in_278031-Mar-11 17:28 
QuestionIssue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 9:01
Andraw Tang31-Mar-11 9:01 
AnswerRe: Issue while Use DLL in MFC Exe Application Pin
Albert Holguin31-Mar-11 9:28
professionalAlbert Holguin31-Mar-11 9:28 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 9:33
Andraw Tang31-Mar-11 9:33 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Albert Holguin31-Mar-11 9:38
professionalAlbert Holguin31-Mar-11 9:38 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 10:53
Andraw Tang31-Mar-11 10: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.