Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSharing MFC objects among threads... Pin
Suhail Yousaf2-Nov-03 19:16
Suhail Yousaf2-Nov-03 19:16 
GeneralFiles and folders Pin
Selevercin2-Nov-03 17:26
Selevercin2-Nov-03 17:26 
GeneralRe: Files and folders Pin
Michael Dunn2-Nov-03 20:04
sitebuilderMichael Dunn2-Nov-03 20:04 
Generaladding a cbutton to a custom control Pin
mindows2-Nov-03 17:11
mindows2-Nov-03 17:11 
GeneralRe: adding a cbutton to a custom control Pin
Antti Keskinen2-Nov-03 23:03
Antti Keskinen2-Nov-03 23:03 
GeneralRe: adding a cbutton to a custom control Pin
mindows3-Nov-03 11:54
mindows3-Nov-03 11:54 
GeneralRe: adding a cbutton to a custom control Pin
Antti Keskinen5-Nov-03 1:44
Antti Keskinen5-Nov-03 1:44 
QuestionHow to manage objects unknown at run-time Pin
Steve Messer2-Nov-03 16:42
Steve Messer2-Nov-03 16:42 
I am creating a dialog based application that loads from an XML configuration file. So, you don't know at run-time how many or which type of objects will be used. The objects that can be created are custom defined using GDI+ and include labels, buttons etc. A button maybe associated with a call to initialize a dll. My need is that each item loaded from the config file will need to do several things 1) Draw themselves 2) Hit testing.

So finally, on to my question. How can I dynamically load lets say 3 buttons and 3 labels and have them do their required functions.

During testing I am doing the following steps at compile time
1) creating the objects in OnInitDialog() CLabel* pLabel = new CLabel;
2) in my draw function I am adding pLabel->Draw()
3) in LButtonDown I am adding if(pLabel->IsHit()).... do something

So, I need to somehow keep list of buttons and list of labels then in the Draw() function for example I to say while( there are buttons) Draw yourself.

How would you go about tackling this?

Hope that makes since.
AnswerRe: How to manage objects unknown at run-time Pin
Christian Graus2-Nov-03 17:08
protectorChristian Graus2-Nov-03 17:08 
GeneralRe: How to manage objects unknown at run-time Pin
Steve Messer2-Nov-03 21:26
Steve Messer2-Nov-03 21:26 
GeneralRe: How to manage objects unknown at run-time Pin
Christian Graus3-Nov-03 9:07
protectorChristian Graus3-Nov-03 9:07 
GeneralRe: How to manage objects unknown at run-time Pin
Steve Messer3-Nov-03 10:23
Steve Messer3-Nov-03 10:23 
GeneralRe: How to manage objects unknown at run-time Pin
Steve S3-Nov-03 23:02
Steve S3-Nov-03 23:02 
GeneralFloat window in MDI application Pin
novachen2-Nov-03 16:35
novachen2-Nov-03 16:35 
QuestionHow can I put my window under any other application window? Pin
golden06062-Nov-03 16:24
golden06062-Nov-03 16:24 
GeneralText in the taskbar vs. title bar Pin
Vancouver2-Nov-03 15:21
Vancouver2-Nov-03 15:21 
GeneralFoundation Problem, #include Problem Pin
Mehran Ziadloo2-Nov-03 15:12
Mehran Ziadloo2-Nov-03 15:12 
GeneralRe: Foundation Problem, #include Problem Pin
ZoogieZork2-Nov-03 15:21
ZoogieZork2-Nov-03 15:21 
GeneralRe: Foundation Problem, #include Problem Pin
Christian Graus2-Nov-03 15:22
protectorChristian Graus2-Nov-03 15:22 
GeneralProblem with CAsyncSocket Pin
Daniel13242-Nov-03 14:30
Daniel13242-Nov-03 14:30 
GeneralHelp with file management... Pin
Snyp2-Nov-03 14:18
Snyp2-Nov-03 14:18 
GeneralRe: Help with file management... Pin
Ravi Bhavnani2-Nov-03 15:03
professionalRavi Bhavnani2-Nov-03 15:03 
GeneralRe: Help with file management... Pin
Christian Graus2-Nov-03 15:21
protectorChristian Graus2-Nov-03 15:21 
GeneralPlease help me Pin
golden06062-Nov-03 14:03
golden06062-Nov-03 14:03 
GeneralRe: Please help me Pin
Christian Graus2-Nov-03 15:24
protectorChristian Graus2-Nov-03 15:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.