Click here to Skip to main content
15,887,436 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Adding combo box to list control Pin
Cool_Dev28-Jul-10 1:22
Cool_Dev28-Jul-10 1:22 
AnswerRe: Adding combo box to list control Pin
David Crow28-Jul-10 3:09
David Crow28-Jul-10 3:09 
AnswerRe: Adding combo box to list control Pin
Rolf Kristensen29-Jul-10 2:29
Rolf Kristensen29-Jul-10 2:29 
QuestionPassing Variable between Files Pin
T.RATHA KRISHNAN28-Jul-10 0:30
T.RATHA KRISHNAN28-Jul-10 0:30 
AnswerRe: Passing Variable between Files Pin
Cool_Dev28-Jul-10 1:10
Cool_Dev28-Jul-10 1:10 
AnswerRe: Passing Variable between Files Pin
Aescleal28-Jul-10 1:27
Aescleal28-Jul-10 1:27 
QuestionScanf problem Pin
sagargulhane27-Jul-10 21:32
sagargulhane27-Jul-10 21:32 
AnswerRe: Scanf problem [modified] Pin
Aescleal27-Jul-10 21:49
Aescleal27-Jul-10 21:49 
So what values have you entered for the two integers before the scanf for the character? If you entered "Fred" at the first prompt then no conversion will happen and there'll still be characters left in the buffer for the final call.

To get around this check the return value of scanf to make sure that you're actually reading and converting something. If it's zero read everything you can and try and try again.

And I've just noticed that you're reading a DWORD using %x. Even if it doesn't fail you want to be reading values through this format specifier into an int.

Cheers,

Ash

PS: The final call to scanf, does it leave a newline character in ch? I can't remember how scanf processes newlines but it might be an avenue to investgate.

Edited to correct my Unglish.

modified on Wednesday, July 28, 2010 4:28 AM

GeneralRe: Scanf problem Pin
sagargulhane28-Jul-10 23:23
sagargulhane28-Jul-10 23:23 
AnswerRe: Scanf problem Pin
«_Superman_»27-Jul-10 22:31
professional«_Superman_»27-Jul-10 22:31 
Questionpdb VC++ Pin
VVVimal27-Jul-10 19:47
VVVimal27-Jul-10 19:47 
AnswerRe: pdb VC++ Pin
Sauro Viti27-Jul-10 20:52
professionalSauro Viti27-Jul-10 20:52 
AnswerRe: pdb VC++ Pin
ARopo28-Jul-10 6:22
ARopo28-Jul-10 6:22 
AnswerRe: pdb VC++ Pin
Abhi Lahare30-Jul-10 8:20
Abhi Lahare30-Jul-10 8:20 
Questiona prob with HKEY Pin
Krauze27-Jul-10 16:18
Krauze27-Jul-10 16:18 
QuestionRe: a prob with HKEY Pin
David Crow27-Jul-10 17:13
David Crow27-Jul-10 17:13 
AnswerRe: a prob with HKEY Pin
Krauze27-Jul-10 17:49
Krauze27-Jul-10 17:49 
QuestionRe: a prob with HKEY Pin
David Crow28-Jul-10 2:29
David Crow28-Jul-10 2:29 
AnswerRe: a prob with HKEY Pin
Krauze28-Jul-10 15:33
Krauze28-Jul-10 15:33 
AnswerRe: a prob with HKEY [modified] Pin
Cool_Dev27-Jul-10 19:20
Cool_Dev27-Jul-10 19:20 
AnswerRe: a prob with HKEY Pin
KarstenK28-Jul-10 2:47
mveKarstenK28-Jul-10 2:47 
QuestionDifferent usage of CWinFormsControl Pin
cppmfcnewbie27-Jul-10 13:22
cppmfcnewbie27-Jul-10 13:22 
AnswerRe: Different usage of CWinFormsControl Pin
Cool_Dev27-Jul-10 18:46
Cool_Dev27-Jul-10 18:46 
GeneralRe: Different usage of CWinFormsControl Pin
cppmfcnewbie28-Jul-10 9:11
cppmfcnewbie28-Jul-10 9:11 
QuestionAssociating a file type with your MFC app Pin
Keith Vitali27-Jul-10 13:11
Keith Vitali27-Jul-10 13:11 

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.