MFC CDialog not showing
- by Jesus_21
here is my problem :
In my Solution, I have 2 projects, one is a lib in which I created a ressource file (mylib.rc) and a dialog template in it. Then I made a class which inherits CDialog and uses this template. But when I instantiate it and call DoModal(), nothing appends...
here the code of my class, is something wrong with it ?
MyDialog.h
/*MyDialog.h*/
#pragma once
#include "../../../resource.h"
class MyDialog : public CDialog
{
enum {IDD=IDD_DLGTEMPLATE};
public:
MyDialog(CWnd* pParent = NULL);
virtual ~MyDialog();
protected:
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
private:
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedCancel();
};
MyDialog.cpp
/*MyDialog.cpp*/
#include "stdafx.h"
#include "MyDialog.h"
MyDialog::MyDialog(CWnd* pParent /*=NULL*/) : CDialog(IDD_DLGTEMPLATE, pParent) {}
MyDialog::~MyDialog() {}
BOOL MyDialog::OnInitDialog() { return TRUE; }
BEGIN_MESSAGE_MAP(MyDialog, CDialog)
ON_BN_CLICKED(IDOK, &MyDialog::OnBnClickedOk)
ON_BN_CLICKED(IDCANCEL, &MyDialog::OnBnClickedCancel)
END_MESSAGE_MAP()
void MyDialog::OnBnClickedOk() { OnOK(); }
void MyDialog::OnBnClickedCancel() { OnCancel(); }