Re: For loop changes in Point structure?
- From: "James Park" <someone@xxxxxxxxxxx>
- Date: Fri, 25 Nov 2005 12:47:03 -0800
"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.
.
- Follow-Ups:
- Re: For loop changes in Point structure?
- From: Ross
- Re: For loop changes in Point structure?
- References:
- For loop changes in Point structure?
- From: Ross
- Re: For loop changes in Point structure?
- From: Heinz Ozwirk
- For loop changes in Point structure?
- Prev by Date: Re: For loop changes in Point structure?
- Next by Date: Re: For loop changes in Point structure?
- Previous by thread: Re: For loop changes in Point structure?
- Next by thread: Re: For loop changes in Point structure?
- Index(es):
Relevant Pages
|