Solved

Dialog a no show?

Posted on 2000-02-13
8
245 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
Technology Partners: 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!

 
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 50 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

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 113
Doc'in system (example?) BA 7 120
Unix Command -- Challenging  question 7 101
Problem to open Excel file 15 220
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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