Adding a DilaogBox?

A

asnowfall

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
 
B

Bruno van Dooren

"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]"
If you decide to add MFC to a project,
you also need to make sure the project configuration (preprocessor macros,
MFC library etc.) are compatible with a real MFC project.
It's bit dissapoonting that .Net does not have its own Dialog object.
???
A form is a Dialog. Why don't you just add another Form to your .NET
project? I see no reason why you should add an MFC dialog in a windows forms
project.
simply add a new form in the designer.
is there a specific reason you want to use MFC?

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
A

asnowfall

I was looking for FORM under resource conext menu.
Now I found it under project context menu.
It worked.

Thanks for your advise
Ramesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top