470,810 Members | 1,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Adding a DilaogBox?

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

Feb 8 '06 #1
2 2117
> "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.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 8 '06 #2
I was looking for FORM under resource conext menu.
Now I found it under project context menu.
It worked.

Thanks for your advise
Ramesh

Feb 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Jamie Fryatt | last post: by
1 post views Thread by hzgt9b | last post: by
3 posts views Thread by Jim Heavey | last post: by
6 posts views Thread by vb | last post: by
9 posts views Thread by Kadett | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.