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

C / C++ / MFC

 
GeneralRe: WSAStartup Pin
David Crow22-Mar-04 8:16
David Crow22-Mar-04 8:16 
GeneralRe: CFile EOF Pin
Ravi Bhavnani21-Mar-04 16:46
professionalRavi Bhavnani21-Mar-04 16:46 
Questionplease help me have a look at the program part below? Pin
vividtang21-Mar-04 14:47
vividtang21-Mar-04 14:47 
AnswerRe: please help me have a look at the program part below? Pin
Christian Graus21-Mar-04 14:58
protectorChristian Graus21-Mar-04 14:58 
QuestionWhere is modeAppend in Serialization? Pin
MeterMan21-Mar-04 13:30
MeterMan21-Mar-04 13:30 
AnswerRe: Where is modeAppend in Serialization? Pin
Rob Manderson21-Mar-04 21:52
protectorRob Manderson21-Mar-04 21:52 
GeneralCDialogBar does not support controls Pin
krugger21-Mar-04 13:19
krugger21-Mar-04 13:19 
GeneralRe: CDialogBar does not support controls Pin
Rob Manderson21-Mar-04 22:04
protectorRob Manderson21-Mar-04 22:04 
Let's assume you're trying to create the object using DDX. In other words, you've embedded an object of the correct type in your class definition and written a DoDataExchange function with the appropriate DDX_Control() call.

It might look like this (simplified).

Header file.
C++
class CMyDialogBar : public CDialogBar
{
public:
    CMyTabbedControl  m_tabControl;

    virtual void DoDataExchange(CDataExchange* pDX);
    virtual void OnInitDialog();
};

and your implementation file looks like this.
C++
void CMyDialogBar::DoDataExchange(CDataExchange* pDX)
{
    CDialogBar::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_MYTABCONTROL, m_tabControl);
}

void CMyDialogBar::OnInitDialog()
{
    CDialogBar::OnInitDialog();

    return TRUE;
}

And yet it doesn't work. As you've noticed, OnInitDialog() isn't called for a DialogBar. The solution I found was to add a function Initialise() to the DialogBar derived class and call it once I knew the dialog bar had been created.
C++
void CMyDialogBar::Initialise()
{
    UpdateData(FALSE);
}

Yes, it's that simple. Just call UpdateData() (make sure the call occurs before any code that tries to use the TabControl) and the control will be created.

Rob Manderson

Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
QuestionHow to develop a printing server? Pin
alongal21-Mar-04 10:28
alongal21-Mar-04 10:28 
Generaledit control Pin
ami121-Mar-04 8:55
ami121-Mar-04 8:55 
GeneralRe: edit control Pin
Nick Parker21-Mar-04 9:02
protectorNick Parker21-Mar-04 9:02 
GeneralCode Writing Pin
nynny21-Mar-04 8:22
nynny21-Mar-04 8:22 
GeneralRe: Code Writing Pin
Nick Parker21-Mar-04 8:44
protectorNick Parker21-Mar-04 8:44 
GeneralRe: Code Writing Pin
Prakash Nadar21-Mar-04 14:18
Prakash Nadar21-Mar-04 14:18 
GeneralRe: Code Writing Pin
Christian Graus21-Mar-04 14:59
protectorChristian Graus21-Mar-04 14:59 
GeneralRe: Code Writing Pin
alex.barylski21-Mar-04 15:49
alex.barylski21-Mar-04 15:49 
GeneralRe: Code Writing Pin
Christian Graus21-Mar-04 15:55
protectorChristian Graus21-Mar-04 15:55 
GeneralRe: Code Writing Pin
David Crow22-Mar-04 7:47
David Crow22-Mar-04 7:47 
GeneralRe: Code Writing Pin
alex.barylski22-Mar-04 9:09
alex.barylski22-Mar-04 9:09 
GeneralGoogle is your friend Pin
Michael P Butler21-Mar-04 22:12
Michael P Butler21-Mar-04 22:12 
GeneralRe: Google is your friend Pin
Maximilien22-Mar-04 1:02
Maximilien22-Mar-04 1:02 
GeneralRe: Google is your friend Pin
Antony M Kancidrowski22-Mar-04 6:23
Antony M Kancidrowski22-Mar-04 6:23 
GeneralRe: Google is your friend Pin
Christian Graus22-Mar-04 9:11
protectorChristian Graus22-Mar-04 9:11 
GeneralRe: Google is your friend Pin
alex.barylski22-Mar-04 9:11
alex.barylski22-Mar-04 9:11 
GeneralRe: Google is your friend Pin
Curi0us_George22-Mar-04 9:20
Curi0us_George22-Mar-04 9:20 

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.