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
Solved

Dialog a no show?

Posted on 2000-02-13
8
239 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
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 105
withoutTen challenge 14 131
fix34  challenge 9 139
Problem to App 4 97
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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