Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: wizard finish button and message box Pin
misha_grewal12-Jun-07 4:54
misha_grewal12-Jun-07 4:54 
QuestionVS2003 for loop bug? Pin
mcsherry12-Jun-07 2:58
mcsherry12-Jun-07 2:58 
AnswerRe: VS2003 for loop bug? Pin
mcsherry12-Jun-07 3:03
mcsherry12-Jun-07 3:03 
GeneralRe: VS2003 for loop bug? Pin
Mark Salsbery12-Jun-07 6:59
Mark Salsbery12-Jun-07 6:59 
GeneralRe: VS2003 for loop bug? Pin
S Douglas12-Jun-07 20:23
professionalS Douglas12-Jun-07 20:23 
AnswerRe: VS2003 for loop bug? Pin
_AnsHUMAN_ 12-Jun-07 3:05
_AnsHUMAN_ 12-Jun-07 3:05 
AnswerRe: VS2003 for loop bug? Pin
CPallini12-Jun-07 3:08
mveCPallini12-Jun-07 3:08 
AnswerRe: VS2003 for loop bug? Pin
Matthew Faithfull12-Jun-07 3:11
Matthew Faithfull12-Jun-07 3:11 
I suspect you're suffering from a change in the syntax between VC6 and Visual Studio 2003 C++ combined with a stray semi colon. The scope of counters in for loops (i in your case ) has changed so that if they're declared in the loop they can't escape from the loop. You possibly have 2 i's happening here in different scopes which is Confused | :confused: to say the least. I now use this syntax to try and be both 'correct' and compatible
<br />
//'correct' and compatible but wouldn't help you pick up this bug<br />
int i = 0;<br />
for( ; i < m_NumberOfObjects; i++ )//Notice no ; here<br />
{<br />
  m_ListObjects[i]->DoStuff();<br />
}<br />
<br />
//recommended to prevent i leaking from scope but I dont' think you can do this anymore :doh:<br />
for( int i; i < m_NumberOfObjects; i++ )//<br />
{<br />
  m_ListObjects[i]->DoStuff();<br />
}<br />


The extra ; has caused the intended loop code to happen only once and declaring the i outside has let you get away with it Frown | :( Perhaps that's why they changed it.

Nothing is exactly what it seems but everything with seems can be unpicked.

AnswerRe: VS2003 for loop bug? Pin
mcsherry12-Jun-07 3:22
mcsherry12-Jun-07 3:22 
GeneralRe: VS2003 for loop bug? Pin
BadKarma12-Jun-07 4:21
BadKarma12-Jun-07 4:21 
AnswerRe: VS2003 for loop bug? Pin
vijay_aroli12-Jun-07 3:33
vijay_aroli12-Jun-07 3:33 
AnswerRe: VS2003 for loop bug? Pin
Michael Dunn12-Jun-07 6:21
sitebuilderMichael Dunn12-Jun-07 6:21 
GeneralRe: VS2003 for loop bug? Pin
Mark Salsbery12-Jun-07 7:02
Mark Salsbery12-Jun-07 7:02 
QuestionHow to detect device Type Pin
VC_RYK12-Jun-07 2:52
VC_RYK12-Jun-07 2:52 
AnswerRe: How to detect device Type Pin
act_x13-Jun-07 6:29
act_x13-Jun-07 6:29 
QuestionChange the color of static control Pin
TobetheWinner12-Jun-07 2:47
TobetheWinner12-Jun-07 2:47 
AnswerRe: Change the color of static control Pin
Hamid_RT12-Jun-07 3:13
Hamid_RT12-Jun-07 3:13 
QuestionChange the color of static control Pin
TobetheWinner12-Jun-07 3:50
TobetheWinner12-Jun-07 3:50 
AnswerRe: Change the color of static control Pin
Hamid_RT12-Jun-07 4:00
Hamid_RT12-Jun-07 4:00 
GeneralRe: Change the color of static control Pin
David Crow12-Jun-07 4:15
David Crow12-Jun-07 4:15 
GeneralRe: Change the color of static control Pin
Hamid_RT12-Jun-07 4:22
Hamid_RT12-Jun-07 4:22 
AnswerRe: Change the color of static control Pin
Max Santos12-Jun-07 6:28
Max Santos12-Jun-07 6:28 
QuestionStop Closing the main Dialog when a child Dailog is open? [modified] Pin
granshah @ eVisionISF12-Jun-07 2:40
granshah @ eVisionISF12-Jun-07 2:40 
QuestionRe: Need to know a method? Pin
David Crow12-Jun-07 2:41
David Crow12-Jun-07 2:41 
AnswerRe: Need to know a method? Pin
Mark Salsbery12-Jun-07 7:08
Mark Salsbery12-Jun-07 7:08 

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.