Questions tagged [cdialog]

In MFC, the base class used for displaying dialog boxes on the screen.

In MFC, the base class used for displaying dialog boxes on the screen.

Dialog boxes are of two types: modal and modeless. A modal dialog box must be closed by the user before the application continues. A modeless dialog box allows the user to display the dialog box and return to another task without canceling or removing the dialog box.

A CDialog object is a combination of a dialog template and a CDialog-derived class. Use the dialog editor to create the dialog template and store it in a resource, then use the Add Class wizard to create a class derived from CDialog.

MSDN Documentation

118 questions
0
votes
2 answers

Intercept CDialog creation

I have a rather large app that displays many different MFC CDialog-derived dialog windows. All of the dialogs are displayed from a central function that is similar to this: void ShowDialog(CDialog& dlg) { dlg.DoModal(); } Now I need to…
DougN
  • 4,407
  • 11
  • 56
  • 81
0
votes
1 answer

Creating a new base CDialogEx derived class

I have a lot of CDialogEx derived classes that do something like this in OnInitDialog: CMeetingScheduleAssistantApp::InitialiseResizeIcon(m_bmpResize, m_lblResize, this); CMeetingScheduleAssistantApp::RestoreWindowPosition(_T("PublisherDB"), this,…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
2 answers

A Dialog derived from CDialog returns -1 after DoModal (MFC/C++)

I have created a Dialog which it's derived from CDialog (MFC does this automatically), but I had to override the OnInitDialog method to make initialization of a ComboBox: BOOL CLogin::OnInitDialog() { CDialog::OnInitDialog(); …
zlogdan
  • 279
  • 1
  • 6
  • 16
0
votes
1 answer

How to make a CDialog?

I have tried multiple things but the base comes to this: #include #include main( int argc, const char* argv[] ) { printf( "\nHello World\n\n" ); CDialog *dlg = new CDialog(); dlg->DoModal(); while (true) { …
0
votes
2 answers

CPropertyPage dialogue OnOk should not close the dialogue if there is an error

I have a class which inherits from CPropertyPage class. I have a OnOk() method and a OnKillActive() method. Whenever I press Ok on the dialogue. OnKillActive() gets called but OnOk() is never called. The problem is depending on a condition I do not…
Arnoj
  • 79
  • 8
0
votes
1 answer

Is it normal for an hwnd to have its high bit set?

I'm passing my HWND to a sub-process so it can send me messages back on its progress. Occasionally I never receive any messages from the sub-process. While investigating, I've found that GetSafeHwnd() of which I'm passing to the subprocess seems to…
0
votes
0 answers

calling cformview child dialog from cdialog parent dialog

I have a parent CDialog dialog box which is supposed to call a CFormView child dialog. I know that, to call a CDialog dialog box, we use DoModal() function. Is there a similar function for CFormView as well to call it from anywhere?
0
votes
1 answer

CButton derived 'SubclassDlgItem's not visible on CDialogBar with VS2015 CLR, but respond to button clicks, worked fine in VC++ 6

I'm trying migrate a VC++ 6 based code to work with VS2015 CLR. I have major functionality working, but UI has some things missing. There's a CDialogBar that hosts CWnd derived objects and CButton objects. CWnd derived objects are being display…
0
votes
1 answer

Create on a CDialog derived class returns 0 with VS2015 CLR, worked fine in VC++ 6

I'm trying migrate a VC++ 6 based code to work with VS2015 CLR. I have major functionality working, but UI has some things missing. I have traced this issue to failures of SubclassDlgItem due to NULL HWnd for parent CWnd. It is NULL, because Create…
0
votes
0 answers

How to use MFC to create a dialog based application by using CDialog::Create without inserting resources from the resource file?

I know how to use CFrameWnd::Create to create a frame based application without inserting resources from the resource file, just like below: #include class MyFrame : public CFrameWnd { public: MyFrame() { …
Banana Code
  • 759
  • 1
  • 12
  • 28
0
votes
1 answer

Passing data between subforms of type CDialog

I have a MS Visual C++ 2005 project where I am trying to have a main dialog box with a section devoted to displaying selectable subform dialogs boxes. Each subform will be of the same size but have a different layout. The selection is performed…
Mike
  • 331
  • 2
  • 9
0
votes
0 answers

CDialog child windows

I just wanted to use insde of a good old MFC Dialog based application 2 more moveable dialogs as childs. After solution wizard, i made a Default Dialog resource (child style) and created 2 dialogs in OnInitDialog of the main Dialog: m_P1 = new…
0
votes
1 answer

SetDlgItemText fills edit field with junk

In my CDialog derived class, in the OnInitDialog() method, I'm pre-filling edit fields with prior configuration loaded from pre-existing config. SetDlgItemText(IDC_EDIT1, LPCTSTR(data->project_file.c_str())); SetDlgItemText(IDC_EDIT2,…
SF.
  • 13,549
  • 14
  • 71
  • 107
0
votes
1 answer

Infinite Thread that may or may not run a CDialog each loop

I am working on a MFC project where I need a separate loop that will run continually or once every few seconds, and each time it may or may not need to run a Dialog to get some input from the user. I was thinking of using AfxBeginThread, but from…
Tbone
  • 129
  • 1
  • 9
0
votes
0 answers

MFC: CDialog from CPropertyPage

I have CPropertySheet which contain multiple CPropertyPage as tabs. In one of the CPropertyPage I have a button and clicking on the button launches a CDialog. I am trying to get the control to CPropertyPage calling GetParent() method inside the…
Anshu Goel
  • 31
  • 3