Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to access all the Editboxes in a form. Pin
David Crow16-Oct-07 2:23
David Crow16-Oct-07 2:23 
AnswerRe: How to access all the Editboxes in a form. Pin
Anand Todkar16-Oct-07 2:34
Anand Todkar16-Oct-07 2:34 
GeneralRe: How to access all the Editboxes in a form. Pin
CodingLover15-Oct-07 19:26
CodingLover15-Oct-07 19:26 
GeneralRe: How to access all the Editboxes in a form. Pin
Hamid_RT15-Oct-07 19:38
Hamid_RT15-Oct-07 19:38 
GeneralRe: How to access all the Editboxes in a form. Pin
CodingLover15-Oct-07 19:47
CodingLover15-Oct-07 19:47 
AnswerRe: How to access all the Editboxes in a form. Pin
Naveen15-Oct-07 19:25
Naveen15-Oct-07 19:25 
GeneralRe: How to access all the Editboxes in a form. Pin
Anand Todkar15-Oct-07 19:31
Anand Todkar15-Oct-07 19:31 
AnswerRe: How to access all the Editboxes in a form. Pin
Nelek15-Oct-07 21:03
protectorNelek15-Oct-07 21:03 
Hi,

I made it very easy with an Array from pointers to the control. In my case, it was:

CMyColorComboBox* m_aComboBoxes [MAX];


then, in the constructor of the Dialog... I wrote the access to them.


m_aComboBoxes[0] = &m_cmcbbVisIn1;
m_aComboBoxes[1] = &m_cmcbbVisIn2;
m_aComboBoxes[2] = &m_cmcbbVisIn3;
m_aComboBoxes[3] = &m_cmcbbVisIn4;


and then I use loops to access, write, delete data from them.

for (int i = 0; i < MAX; i++)
   m_aComboBoxes [MAX]->ResetContent ();


I have done it in that way because I had the member variables from class wizard. But you can use the idea as well without having any variable and using GetDlgItem (ID). If you use the GetDlgItem ... then you must use OnInitDialog or on InitialUpdate. Because if you use the constructor to give the pointers... then you will have an assertion because the window doesn't exist when trying to access.

Hope it helps

Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

Wink | ;)

QuestionList iteration Problem [modified] Pin
ashishbhatt15-Oct-07 19:04
ashishbhatt15-Oct-07 19:04 
AnswerRe: List iteration Problem Pin
zakkas248315-Oct-07 20:11
zakkas248315-Oct-07 20:11 
GeneralRe: List iteration Problem Pin
ashishbhatt15-Oct-07 20:29
ashishbhatt15-Oct-07 20:29 
GeneralRe: List iteration Problem Pin
Nelek15-Oct-07 21:05
protectorNelek15-Oct-07 21:05 
GeneralRe: List iteration Problem Pin
zakkas248315-Oct-07 21:38
zakkas248315-Oct-07 21:38 
GeneralRe: List iteration Problem Pin
ashishbhatt15-Oct-07 22:06
ashishbhatt15-Oct-07 22:06 
GeneralRe: List iteration Problem Pin
ashishbhatt15-Oct-07 22:17
ashishbhatt15-Oct-07 22:17 
GeneralRe: List iteration Problem Pin
zakkas248315-Oct-07 22:59
zakkas248315-Oct-07 22:59 
GeneralRe: List iteration Problem Pin
ashishbhatt15-Oct-07 23:16
ashishbhatt15-Oct-07 23:16 
GeneralRe: List iteration Problem Pin
David Crow16-Oct-07 2:29
David Crow16-Oct-07 2:29 
GeneralRe: List iteration Problem Pin
David Crow16-Oct-07 2:30
David Crow16-Oct-07 2:30 
QuestionBuild error in calling static library function Pin
MKUser15-Oct-07 16:59
MKUser15-Oct-07 16:59 
QuestionMonitoring files Pin
dArK cHAriSmA15-Oct-07 16:06
dArK cHAriSmA15-Oct-07 16:06 
AnswerRe: Monitoring files [modified] Pin
azonenberg15-Oct-07 17:52
azonenberg15-Oct-07 17:52 
AnswerRe: Monitoring files Pin
Hamid_RT15-Oct-07 19:32
Hamid_RT15-Oct-07 19:32 
QuestionVS6.0 Modeless Dialog as a static library or DLL Pin
Ralph_L15-Oct-07 9:48
Ralph_L15-Oct-07 9:48 
AnswerRe: VS6.0 Modeless Dialog as a static library or DLL Pin
Mark Salsbery15-Oct-07 10:26
Mark Salsbery15-Oct-07 10:26 

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.