Hello, i'm writing a MFC C++ app. It contains animation effects(e.g. moving bitmaps). So i have an array that contains the coordinates of each shape(i'm using rectangles, ellipses). My code is simple
int y[100]; //the y-coordinate of each shape
Then in OnInitDialog() i use SetTimer(1, 100, NULL); And in OnTimer(UINT nIDEvent)
my code is:
for(int j=1; j<=100; j++)
{
if(y[j]>500)
{
KillTimer(j);
SetTimer(j+1, 100, NULL);
}
}
My point is that i'm destroying the timer event in OnTimer(UINT nIDEvent) and creating a new timer in the same function. Does MFC allow that activity and are there any problems doing that, such as memory leaks. Thanks!