I am making an MFC application where, inside a CScrollView, I want have a stack of dialogs going down the CScrollView. The way I am doing this is that each time I create a new dialog, I call MoveWindow to move it underneath the previous one.
The problem I am having is that it seems that after I insert about 200 windows (each about 160 high), the new windows will not go any lower than the position of y = 32767 (SHRT_MAX).
I was initially thinking that the problem must be because of some sort of limit on the CScrollView size, but that doesn't seem to be the case, as I can scroll below y=32767 (but my dialogs are stuck at 32767). So it seems that there is some sort of limit for setting the location of a dialog? I've tried overriding OnGetMinMaxInfo in my dialog class but for some strange reason that does not get call when MoveWindow is called, contary to what I believe the MFC documentation says. I've also tried SetWindowPos and the result is the same.
Has anyone encountered a similar problem? Would greatly appreciate any help.