I tried to add DialogBox to my WindowsForms application; i get
following compilation error.
"fatal error C1189: #error : Building MFC application with /MD[d] (CRT
dll version) requires MFC shared dll version. Please #define _AFXDLL or
do not use /MD[d]"
Here is the code snippet...
================================================== ================
//////////stdafx.h
#pragma once
#include <afxwin.h>
///////// TestDlg.h
#pragma once
// TestDlg dialog
class TestDlg : public CDialog
{
DECLARE_DYNAMIC(TestDlg)
public:
TestDlg(CWnd* pParent = NULL); // standard constructor
virtual ~TestDlg();
// Dialog Data
enum { IDD = IDD_DIALOG1 };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
};
/////////TestDlg.cpp
#include "stdafx.h"
#include "TestDlg.h"
IMPLEMENT_DYNAMIC(TestDlg, CDialog)
TestDlg::TestDlg(CWnd* pParent /*=NULL*/)
: CDialog(TestDlg::IDD, pParent)
{
}
TestDlg::~TestDlg()
{
}
void TestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(TestDlg, CDialog)
END_MESSAGE_MAP()
================================================== =============
I tried moving #include <afxwin.h> to TestDlg.h and it did not help.
Please let me know how ro achieve this.
It's bit dissapoonting that .Net does not have its own Dialog object.
Thanks
Ramesh