-
June 19th, 2006, 02:30 AM
#1
Dynamic allocation in MFC
Why doesn't MFC supports dynamic creation of controls? I have found my self in many situations, where this feature would help a lot and simplify program design. (perticular in simple dialogs, where user is asked to input some data).
In that way it would be possible to create truely dynamic programs.
By this question I meen to avoid, common post on VC++ section of CodeGuru forums witch is: "Just create 10-50 CEdit controls on dialog, and hide them, when you need them use ShowWindow(SW_SHOW)". I greatly dissagree with this programming practice.
And another question is easy one but I haven't found an answer yet. It is about class view in VC++. I have a problem where I add some project files, like FastObject's hxx file or MySQL or anything, and it automatically includes all classes and function found in it, and then class view is usselles couse there's just too many functions and classess, Is there a way to avoid that?
Regards:
Dario Maljur
You just divided by zero, didn't you?
-
June 20th, 2006, 05:32 AM
#2
Re: Dynamic allocation in MFC
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
June 20th, 2006, 07:13 AM
#3
Re: Dynamic allocation in MFC
Originally Posted by Odiee
Why doesn't MFC supports dynamic creation of controls?
Well, it does.
I am not sure what do you mean by dynamic creation.
1. It may mean instantiation of the object at the compile time and window creation at the run time.
2. Object instantiation and window creation at the run time.
Both are supported therefore I am not sure what is your question referring to.
Originally Posted by Odiee
By this question I meen to avoid, common post on VC++ section of CodeGuru forums witch is: "Just create 10-50 CEdit controls on dialog, and hide them, when you need them use ShowWindow(SW_SHOW)". I greatly dissagree with this programming practice.
Why? I fail to see what is wrong with it.
Originally Posted by Odiee
And another question is easy one but I haven't found an answer yet.
Unfortunately that is true and there is nothing you can do about it. That is the way calss view was designed.
Originally Posted by Odiee
Why can't CButton and CEdit be dynamically allocated. . .
They can.
Originally Posted by Odiee
and why did I just spent 54 minutes on implementing Popup menu?
you should be able to answer this question.
You are probably in the process of learning how to do it. It takes me about 2 minutes.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|