Click here to Skip to main content
16,011,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: T2W Pin
Joaquín M López Muñoz19-Sep-02 9:40
Joaquín M López Muñoz19-Sep-02 9:40 
GeneralRe: T2W Pin
ns19-Sep-02 9:59
ns19-Sep-02 9:59 
GeneralRe: T2W Pin
Joaquín M López Muñoz19-Sep-02 10:19
Joaquín M López Muñoz19-Sep-02 10:19 
GeneralRe: T2W Pin
ns19-Sep-02 10:25
ns19-Sep-02 10:25 
GeneralDbl Click in control - DateTimePicker Pin
john john mackey19-Sep-02 9:07
john john mackey19-Sep-02 9:07 
GeneralRe: Dbl Click in control - DateTimePicker Pin
john john mackey19-Sep-02 9:08
john john mackey19-Sep-02 9:08 
GeneralOnInitDialog question Pin
ns19-Sep-02 9:02
ns19-Sep-02 9:02 
GeneralRe: OnInitDialog question Pin
TyMatthews19-Sep-02 9:28
TyMatthews19-Sep-02 9:28 
Yes, you've got it right. Personally, I would make an enumeration variable in the dialog class and use that as the flag. That way, you can switch() on the flag and support future enhancements when you want more than two different behaviors. Just as soon as you've written all the code for two modes you'll find that you now want to have three Smile | :) The additional effort involved is very little.

<code>
class CMyDlg : public CDialog
{
public:
    typedef enum
    {
        Mode1,
        Mode2,
        Mode3
    } MyDlgModes;
 
private:
    MyDlgModes m_Mode;
 
public:
    SetDlgMode( MyDlgModes Mode )
    {
        m_Mode = Mode;
    }
};
 
BOOL CMyDlg::OnInitDialog()
{
   switch( m_Mode )
   {
   case Mode1:
       ... do stuff
   case Mode2:
       ... etc
   
   }
}
 
MyFunc()
{
    CMyDlg dlg;
    dlg.SetDlgMode( CMyDlg::MyDlgModes::Mode1 );
    dlg.DoModal();    
}


Ty


"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein


GeneralRe: OnInitDialog question Pin
ns19-Sep-02 9:37
ns19-Sep-02 9:37 
GeneralRe: OnInitDialog question Pin
TyMatthews19-Sep-02 9:58
TyMatthews19-Sep-02 9:58 
GeneralRe: OnInitDialog question Pin
ns20-Sep-02 11:25
ns20-Sep-02 11:25 
GeneralRe: OnInitDialog question Pin
TyMatthews20-Sep-02 12:41
TyMatthews20-Sep-02 12:41 
GeneralWow! Thanks!!! Pin
ns20-Sep-02 12:53
ns20-Sep-02 12:53 
GeneralRe: Wow! Thanks!!! Pin
TyMatthews20-Sep-02 13:05
TyMatthews20-Sep-02 13:05 
GeneralRe: OnInitDialog question Pin
Joaquín M López Muñoz19-Sep-02 9:30
Joaquín M López Muñoz19-Sep-02 9:30 
Generalparent IShellFolder on windows 98 Pin
luc219-Sep-02 8:24
luc219-Sep-02 8:24 
GeneralRe: parent IShellFolder on windows 98 Pin
Joaquín M López Muñoz19-Sep-02 9:48
Joaquín M López Muñoz19-Sep-02 9:48 
GeneralRe: parent IShellFolder on windows 98 Pin
luc219-Sep-02 23:27
luc219-Sep-02 23:27 
General_int64 store / restore problem Pin
Anonymous19-Sep-02 8:20
Anonymous19-Sep-02 8:20 
GeneralRe: _int64 store / restore problem Pin
Joaquín M López Muñoz19-Sep-02 9:27
Joaquín M López Muñoz19-Sep-02 9:27 
QuestionHow to pass a CList to another function? Pin
John Wong19-Sep-02 8:15
John Wong19-Sep-02 8:15 
AnswerRe: How to pass a CList to another function? Pin
Joaquín M López Muñoz19-Sep-02 9:20
Joaquín M López Muñoz19-Sep-02 9:20 
GeneralRe: How to pass a CList to another function? Pin
John Wong19-Sep-02 9:39
John Wong19-Sep-02 9:39 
GeneralUNICODE and DataBases Pin
Member 14905119-Sep-02 7:54
Member 14905119-Sep-02 7:54 
GeneralRe: UNICODE and DataBases Pin
Michael Dunn19-Sep-02 8:02
sitebuilderMichael Dunn19-Sep-02 8:02 

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.