I haven't begun yet, because I'm still a little vague on this. My
apologies for not explaining properly...
control? That's why I asked about arrays.
I hope that's clearer... no 'crash' occured as yet, I was just wondering
about memory use and such.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
I'm not sure what the question is about. Creating custom controls and
control arrays
dynamically is fairly straightforward, so the question of how to do it
without crashing
the program is simple: do it correctly. It is always possible to crash a
program by
incorrect programming, but since the act of creating windows in and of
itself does not
create any situations where any interpretation of the numerous meanings
of "crash" would
apply, the only reason for any failure would be because you did something
wrong.
CObArray is largely irrelevant. You ;haven't specified if all the
controls are one type,
but I'm assuming by implication here that they are, for example,
CMyWhatever class
controls. Then I fail to see what value CObArray would have;
CArray<CMyWhatever,
CMyWhatever&> would make sense, of course, but CObArray seems pointless.
I have no idea what you mean by "best/most efficient". There's no one
"best" way, and I
fail to see how "efficiency" can even enter the discussion. You have not
said if the
number of controls is known, for example, at OnInitDialog/OnInitialUpdate
time or can
change truly dynamically during the execution of the CDialog/CFormView,
with controls
coming and going as needed. Is there a known fixed upper bound or is it
"unlimited"?
Define "unlimited". Ten, Hundred, Thousand?
The question is far too ill-formed to answer.
However, you want to look at the ON_..._RANGE message map entries to
handle the events
from the control.
joe
On Mon, 14 Aug 2006 07:58:45 -0400, "saywhat" <no@fuk.no> wrote:
I have a project where I want to use some customized controls. I will
have
to create a number of them, the number depends on the number of results
that
a function returns.
How can I do this without crashing the prog? What's the best/most
effiecient way to create an array of controls? Can CObArray be used for
this?
TIA
b
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm