Click here to Skip to main content
15,910,980 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to send a message from a object to its parents? Pin
thanh-hai.bui12-Apr-05 22:30
thanh-hai.bui12-Apr-05 22:30 
AnswerRe: How to send a message from a object to its parents? Pin
Joel Holdsworth12-Apr-05 22:54
Joel Holdsworth12-Apr-05 22:54 
GeneralRe: How to send a message from a object to its parents? Pin
thanh-hai.bui13-Apr-05 0:50
thanh-hai.bui13-Apr-05 0:50 
AnswerRe: How to send a message from a object to its parents? Pin
ThatsAlok12-Apr-05 23:01
ThatsAlok12-Apr-05 23:01 
GeneralConversion to LONGLONG Pin
fardak12-Apr-05 21:57
fardak12-Apr-05 21:57 
GeneralRe: Conversion to LONGLONG Pin
Joel Holdsworth12-Apr-05 22:17
Joel Holdsworth12-Apr-05 22:17 
GeneralRe: Conversion to LONGLONG Pin
fardak12-Apr-05 22:34
fardak12-Apr-05 22:34 
GeneralRe: Conversion to LONGLONG Pin
Joel Holdsworth12-Apr-05 22:44
Joel Holdsworth12-Apr-05 22:44 
Just noticed one minor bug. The code should be like this:
LONGLONG result = 0;
int cursor = 0;
int length = _tcslen(mystring);

for(int i = 0; i < length; i++)
{
	result <<= 4;
	if(mystring[i] >= _T('0') && mystring[i] <= _T('9'))
		result |= (mystring[i] - _T('0'));
	else if(mystring[i] >= _T('a') && mystring[i] <= _T('f'))
		result |= (mystring[i] - _T('a') + 10);
	else if(mystring[i] >= _T('A') && mystring[i] <= _T('F'))
		result |= (mystring[i] - _T('A') + 10);
	else if(mystring[i] == _T(' ') ||
		mystring[i] == _T('\t'))	// Any characters that you want to ignore
		continue;				// Otherwise stop scanning if we encounter any non-hex characters
	else break;
	cursor++;
	if(cursor >= sizeof(result) * 2)	// Stop scanning when we reach the require number of digits
		break;				// You could have an "overflow" error message sent here, if you want
}
The reason I'm making all these mistakes, is that i've got no compiler to test this stuff on right now!

Joel Holdsworth

Wanna give me a job this summer?
Check out my online CV and project history[^]
GeneralRe: Conversion to LONGLONG Pin
fardak12-Apr-05 23:27
fardak12-Apr-05 23:27 
GeneralRe: Conversion to LONGLONG Pin
Joel Holdsworth12-Apr-05 23:39
Joel Holdsworth12-Apr-05 23:39 
GeneralRe: Conversion to LONGLONG Pin
fardak13-Apr-05 0:02
fardak13-Apr-05 0:02 
GeneralRe: Conversion to LONGLONG Pin
David Crow13-Apr-05 2:36
David Crow13-Apr-05 2:36 
GeneralRe: Conversion to LONGLONG Pin
Joel Holdsworth13-Apr-05 3:21
Joel Holdsworth13-Apr-05 3:21 
GeneralRe: Conversion to LONGLONG Pin
fardak13-Apr-05 4:42
fardak13-Apr-05 4:42 
GeneralRe: Conversion to LONGLONG Pin
Michael Dunn13-Apr-05 2:20
sitebuilderMichael Dunn13-Apr-05 2:20 
GeneralRe: Conversion to LONGLONG Pin
fardak13-Apr-05 4:35
fardak13-Apr-05 4:35 
GeneralRe: Conversion to LONGLONG Pin
Michael Dunn13-Apr-05 7:22
sitebuilderMichael Dunn13-Apr-05 7:22 
GeneralRe: Conversion to LONGLONG Pin
fardak13-Apr-05 22:44
fardak13-Apr-05 22:44 
GeneralRe: Conversion to LONGLONG Pin
fardak13-Apr-05 22:50
fardak13-Apr-05 22:50 
Generaldirectx Pin
shumyla198312-Apr-05 21:36
shumyla198312-Apr-05 21:36 
GeneralRe: directx Pin
22491712-Apr-05 22:04
22491712-Apr-05 22:04 
Generaldouble to char conversion vc++ Pin
nehathoma12-Apr-05 21:04
nehathoma12-Apr-05 21:04 
GeneralRe: double to char conversion vc++ Pin
Cedric Moonen12-Apr-05 21:08
Cedric Moonen12-Apr-05 21:08 
GeneralRe: double to char conversion vc++ Pin
Anonymous12-Apr-05 21:15
Anonymous12-Apr-05 21:15 
GeneralRe: double to char conversion vc++ Pin
John R. Shaw12-Apr-05 21:36
John R. Shaw12-Apr-05 21:36 

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.