Click here to Skip to main content
15,917,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow can I access variable in View class from my dialog member function? Pin
mr20037-Aug-03 12:23
mr20037-Aug-03 12:23 
AnswerRe: how can I access variable in View class from my dialog member function? Pin
John M. Drescher7-Aug-03 12:33
John M. Drescher7-Aug-03 12:33 
GeneralRe: how can I access variable in View class from my dialog member function? Pin
mr20037-Aug-03 13:28
mr20037-Aug-03 13:28 
GeneralRe: how can I access variable in View class from my dialog member function? Pin
John M. Drescher7-Aug-03 13:31
John M. Drescher7-Aug-03 13:31 
GeneralRe: how can I access variable in View class from my dialog member function? Pin
mr20037-Aug-03 13:48
mr20037-Aug-03 13:48 
GeneralRe: how can I access variable in View class from my dialog member function? Pin
Maximilien7-Aug-03 14:23
Maximilien7-Aug-03 14:23 
GeneralRe: how can I access variable in View class from my dialog member function? Pin
John M. Drescher7-Aug-03 15:41
John M. Drescher7-Aug-03 15:41 
AnswerRe: how can I access variable in View class from my dialog member function? Pin
PremL8-Aug-03 5:31
PremL8-Aug-03 5:31 
Getting your data directly from the view in a single document application is bad design to some degree, because it breaks the SDI template. You can expect major reusability issues when you link your dialog directly to the view, since the view in turn is linked to the document.

If you can help it, try declaring member variables for the data in the dialog and fill those members with the actual data from the document just before you call domodal. After the dialog returns, read the changes from the member variables back to the document. This way you’ll get a dialog class, which does not ‘directly’ depend on a particular view or document class.

Concepts like this will not make your app work any different, but they will help maintenance and improve reusability.


Lorenz Prem
Microsoft Corporation
Generalrand ( ) Pin
DaveE9th7-Aug-03 12:08
DaveE9th7-Aug-03 12:08 
GeneralRe: rand ( ) Pin
Bob Stanneveld7-Aug-03 12:19
Bob Stanneveld7-Aug-03 12:19 
GeneralRe: rand ( ) Pin
DaveE9th7-Aug-03 13:13
DaveE9th7-Aug-03 13:13 
GeneralRe: rand ( ) Pin
John M. Drescher7-Aug-03 13:26
John M. Drescher7-Aug-03 13:26 
GeneralRe: rand ( ) Pin
Bob Stanneveld7-Aug-03 21:41
Bob Stanneveld7-Aug-03 21:41 
GeneralRe: rand ( ) Pin
Joe Woodbury7-Aug-03 12:23
professionalJoe Woodbury7-Aug-03 12:23 
GeneralRe: rand ( ) Pin
DaveE9th7-Aug-03 12:27
DaveE9th7-Aug-03 12:27 
GeneralRe: rand ( ) Pin
DaveE9th7-Aug-03 13:32
DaveE9th7-Aug-03 13:32 
GeneralRe: rand ( ) Pin
kochhar7-Aug-03 18:56
kochhar7-Aug-03 18:56 
GeneralRe: rand ( ) Pin
DaveE9th7-Aug-03 19:30
DaveE9th7-Aug-03 19:30 
GeneralCFile problem Pin
DougW487-Aug-03 11:21
DougW487-Aug-03 11:21 
GeneralRe: CFile problem Pin
Bob Stanneveld7-Aug-03 12:13
Bob Stanneveld7-Aug-03 12:13 
GeneralRe: CFile problem Pin
DougW487-Aug-03 13:22
DougW487-Aug-03 13:22 
GeneralRe: CFile problem Pin
Ryan Binns7-Aug-03 13:30
Ryan Binns7-Aug-03 13:30 
QuestionHow to reset Timers Pin
gc_17-Aug-03 10:58
gc_17-Aug-03 10:58 
AnswerRe: How to reset Timers Pin
PJ Arends7-Aug-03 11:22
professionalPJ Arends7-Aug-03 11:22 
AnswerRe: How to reset Timers Pin
Jack_pt7-Aug-03 16:17
Jack_pt7-Aug-03 16:17 

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.