SetWindowPos Strange problem

I have a View application and I'm creating 2 child windows on it. Whenever the user resize the window, I'm resizing the two child windows. Now here is the strange part: if I'm calling SetWindowPos for the second window, I'm getting into a loop in which the on drew on the view is being clad constantly. The second window is derived from CWnd, and doesn't have any code in it but the on pain message that looks like this:

void CChatsWindows::OnPaint()

{

CPaintDC dc(this);

/*

if (m_windows_were_created)

{

CalculateChatSpace();

}

else

{

CreateChatSpace();

}

*/

}

And as you can see, I remarked this section in order to make sure this is not the problem. Also, the debugger is not hitting this function when it's in the loop. Anyone have an idea



Answer this question

SetWindowPos Strange problem