Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dialog a no show?

Posted on 2000-02-13
8
Medium Priority
?
264 Views
Last Modified: 2013-11-20
I've created a dialog resource and let the class wizard create a shell class for me. i've added some callbacks and accessor functions to it and new when I call DoMModal() the dialog doesnt show up on the screen, any ideas why? I am creating the dialog in my OnNewDocument() call back.
0
Comment
Question by:cpa802
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Author Comment

by:cpa802
ID: 2517100
Sorry :) Source might help :)


class CMUDDialog : public CDialog
{
// Construction
public:
      CMUDDialog(CWnd* pParent = NULL);   // standard constructor
      char *GetName();
      char *GetAddress();
      int GetPort();
      virtual BOOL OnInitDialog();

// Dialog Data
      //{{AFX_DATA(CMUDDialog)
            // NOTE: the ClassWizard will add data members here
      //}}AFX_DATA


// Overrides
      // ClassWizard generated virtual function overrides
      //{{AFX_VIRTUAL(CMUDDialog)
      protected:
      virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
      //}}AFX_VIRTUAL

// Implementation
protected:

      // Generated message map functions
      //{{AFX_MSG(CMUDDialog)
      afx_msg void OnOk();
      afx_msg void OnCancel();
      afx_msg void OnRename();
      afx_msg void OnDelete();
      afx_msg void OnAdd();
      //}}AFX_MSG
      DECLARE_MESSAGE_MAP()
};


CMUDDialog::CMUDDialog(CWnd* pParent /*=NULL*/)
      : CDialog(IDD_CONNECT, pParent)
{
      //{{AFX_DATA_INIT(CMUDDialog)
            // NOTE: the ClassWizard will add member initialization here
      //}}AFX_DATA_INIT
}


void CMUDDialog::DoDataExchange(CDataExchange* pDX)
{
      CDialog::DoDataExchange(pDX);
      //{{AFX_DATA_MAP(CMUDDialog)
            // NOTE: the ClassWizard will add DDX and DDV calls here
      //}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMUDDialog, CDialog)
      //{{AFX_MSG_MAP(CMUDDialog)
      ON_BN_CLICKED(IDC_BOK, OnOk)
      ON_BN_CLICKED(IDC_BRENAME, OnRename)
      ON_BN_CLICKED(IDC_BDELETE, OnDelete)
      ON_BN_CLICKED(IDC_BCANCEL, OnCancel)
      ON_BN_CLICKED(IDC_BADD, OnAdd)
      //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMUDDialog message handlers

void CMUDDialog::OnOk()
{
      // TODO: Add your control notification handler code here
      EndDialog(IDOK);
}

void CMUDDialog::OnCancel()
{
      // TODO: Add your control notification handler code here
      EndDialog(IDCANCEL);
}

void CMUDDialog::OnRename()
{
      // TODO: Add your control notification handler code here
      
}

void CMUDDialog::OnDelete()
{
      CListCtrl *list;

      list=(CListCtrl*)GetDlgItem(IDC_WORLD_LIST);
}

void CMUDDialog::OnAdd()
{
      // TODO: Add your control notification handler code here
      
}

char *CMUDDialog::GetName(){
   return NULL;
}

char *CMUDDialog::GetAddress(){
   return NULL;
}


int CMUDDialog::GetPort(){
   return 0;
}

BOOL CMUDDialog::OnInitDialog(){
      //Initialize list control
      return TRUE;
}
0
 
LVL 1

Expert Comment

by:aperdon
ID: 2517114
Check your MessageMap
0
 
LVL 2

Expert Comment

by:waseemanis
ID: 2517529
Check your OnInitDialog func.

I think you'll need to call the CDialog::OnInitDialog, the first thing in the function.


BOOL CMUDDialog::OnInitDialog()
{
// this is were i think you are missing
CDialog::OnInitDialog();
//Initialize list control
return TRUE;
}

Luck,
Waseem.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:V_Bapat
ID: 2517765
Try what Waseem suggested. In case you are calling CDialog::OnInitDialog(), post the OnInitDialog() and constructor(if there is something) code. It would help us analyze the problem better.

Vicky
0
 
LVL 2

Accepted Solution

by:
bbousquet earned 150 total points
ID: 2517811
Is your dialog marked as 'Visible' in the resource editor?

[This sounds pretty dumb, but it's happened to the best of us!]
0
 
LVL 1

Expert Comment

by:oarguimb
ID: 2518111
I'm agreee with 'waseemanis'

The call to base class CDialog::OnInitDialog()  is missing !!
So it didn't do anything.
0
 

Author Comment

by:cpa802
ID: 2524870
The call to CDialog::OnInitDialog() didnt help, actually I couldnt even get the dialog to appear before I overode the method, I only added it in case I had to.
Also the dialog is marked as visible.
0
 

Author Comment

by:cpa802
ID: 2524891
I loaded the .rc file in to a text editor and found that the dialog didnt have the visible attribute on it and was actually set as disabled. I reloaded the .rc file and it magically decided to tell me that it was disabled and I changed the proper styles.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question