Originally posted by Xeon

Let's face it : sometimes, I really feel as though the minds and powers of those famous industry experts lies in me, such as Jeff Prosise, Dino Esposito, Jeffrey Richter, and John Robbins.
In short : I am the man.
you're kidding us right? either i am misunderstanding the question or you dont understand the 'new' keyword.

Originally posted by Xeon

Now, I managed to solve this problem with a solution : create local pointers to achieve the creation of n-th number of modeless dialogs at run-time, and storing these pointers in a CArray template class so that I can access them later.
yes this is a solution and i realize to you it is eye opening and wonderful but it certainly doesnt put you in a league with above mentioned experts by any means

Originally posted by Xeon

When I run the program and click the buttons and such, I was expecting to get an Access Violation error, cos' u see, the local dialog pointers(pDlg) SHOULD ALL BE OUTTA SCOPE and be DESTROYED when the OnCreatedlgs() function ends, and when I try to access them in the OnChangeText() function, an Access Violation error should occur, cos' I'm trying to access something that's already invalid; gone outta scope; destroyed.

But INSTEAD........(I dunno why)........everything works as though they're in God's garden! Isn't this crazy! This is even more mysterious than the Bermuda Triangle! Crazy!
when you use the keyword 'new' that allocates memory which does not go out of scope when the function ends it is really just that simple. the list of pointers you make is valid after the function ends, as a matter of fact you must free this memory before your program ends or the memory you new'ed will be leaked.