Re: For loop changes in Point structure?




"Heinz Ozwirk" <hozwirk.SPAM@xxxxxxxx> wrote in message
news:43877696$0$27882$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> "Ross" <Ross@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
> news:01C28697-4E0B-42D6-8557-E5969316735E@xxxxxxxxxxxxxxxx
> ...
>> Hello,
>>
>> I am trying my first Windows program without copying Petzold's examples,
>> however using what I have learnt, and I seem to have an unexpected
>> result.
>>
>> Basically, I have successfully managed to put a square background with
>> text
>> at the far top right of my client area. Further more you can press the
>> function keys F1 to change the OPAQUE option of the square, F2 for the
>> Brush
>> color of the square and F3 to select one of three possible text colors.
>> How
>> ever when I introduce a simple for loop at the end of my WM_PAINT messge
>> rountine, I get my square being drawn at the far left. I don't know why!
>> And
>> if I remove the for loop it works fine.
>> The for loop just clears an array and has nothing to do with the
>> coordinates
>> of my rectangle function, and yet it seems that the for loop changes
>> these
>> coordinates.
> ...
>> static int iTemp[2];
> ...
>> for (j = 0; j < 3; j++)
>> { iTemp[j] = 0; }
>
> What do you expect when you try to modify the third element in an array
> with only two elements?
>
> Heinz
>

The pts array also has the same problem.


.



Relevant Pages

  • Re: For loop changes in Point structure?
    ... > function keys F1 to change the OPAQUE option of the square, ... > if I remove the for loop it works fine. ... > The for loop just clears an array and has nothing to do with the ... What do you expect when you try to modify the third element in an array with ...
    (microsoft.public.vc.language)
  • Re: For loop changes in Point structure?
    ... OKAY, You have a point, so I have changed my array declaration to 3 elements ... copied it and compiled, its weird, its like the rectangle coordinates get ... changed just because we run a for loop in WM_PAINT. ... >>> color of the square and F3 to select one of three possible text colors. ...
    (microsoft.public.vc.language)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)