title: Error C2065 when using two MFC projects
body: <p>I have a Dialog with a <code>CListCtrl</code> with some data, below is a button. My second project is a dialog with a tri-state checkbox. Now I want to couple both projects, so when selecting a list item and clicking the button the tristate dialog appers showing something. </p>
  
  <p>Well, I added the second project to another one and changed its type to .dll, but receive a build error </p>
  
  <p><code>error C2065: 'IDD_MFCAPP2_DIALOG' : undeclared identifier</code></p>
  
  <p><code>IDD_MFCAPP2_DIALOG</code> is the id of he checkbox dialog. When adding the project both id's had the same value, so I changed this in <code>resource.h</code> manually to a different one, but it did not solve the problem. The projects work very well separately. What do I miss?</p>
  
  <p>UPDATE:
  I have reduced the project to a minimum, the problem is the same</p>
  
  <p><strong>MFCApp1Dlg.h</strong></p>
  
  <pre><code>class CMFCApp1Dlg : public CDialogEx
  {
  // Construction
  public:
      CMFCApp1Dlg(CWnd* pParent = NULL);  // standard constructor
  
  // Dialog Data
      enum { IDD = IDD_MFCAPP1_DIALOG };
  
      protected:
      virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  
  
  // Implementation
  protected:
      HICON m_hIcon;
  
      // Generated message map functions
      virtual BOOL OnInitDialog();
      afx_msg void OnPaint();
      afx_msg HCURSOR OnQueryDragIcon();
      DECLARE_MESSAGE_MAP()
  public:
    afx_msg void OnBnClickedButtonChange();
    CButton m_BtnChange;
  };
  </code></pre>
  
  <p>Its cpp file only contains the standard things. Just the button handler calls other app</p>
  
  <pre><code>void CMFCApp1Dlg::OnBnClickedButtonChange()
  {
   CMFCApp2Dlg dlg;
   if (dlg.DoModal())
   {
      // do something...
    }
  }
  </code></pre>
  
  <p><strong>MFCApp2Dlg.h</strong> looks the same</p>
  
  <pre><code>class CMFCApp2Dlg : public CDialogEx
  {
  // Construction
  public:
      CMFCApp2Dlg(CWnd* pParent = NULL);  // standard constructor
  
  // Dialog Data
      enum { IDD = IDD_MFCAPP2_DIALOG };
  
      protected:
      virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  
  
  // Implementation
  protected:
      HICON m_hIcon;
  
      // Generated message map functions
      virtual BOOL OnInitDialog();
      afx_msg void OnPaint();
      afx_msg HCURSOR OnQueryDragIcon();
      DECLARE_MESSAGE_MAP()
  };
  </code></pre>
  
  <p>The .rc file are also not spectaculary</p>
  
  <pre><code>IDD_MFCAPP1_DIALOG DIALOGEX 0, 0, 315, 151
  STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME
  EXSTYLE WS_EX_APPWINDOW
  CAPTION "MFCApp1"
  FONT 8, "MS Shell Dlg", 0, 0, 0x1
  BEGIN
      DEFPUSHBUTTON   "OK",IDOK,76,119,50,14
      PUSHBUTTON      "Cancel",IDCANCEL,157,117,50,14
      PUSHBUTTON      "Push me!",IDC_BUTTON_CHANGE,121,44,50,14
  END
  </code></pre>
  
  <p>and</p>
  
  <pre><code>IDD_MFCAPP2_DIALOG DIALOGEX 0, 0, 203, 101
  STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME
  EXSTYLE WS_EX_APPWINDOW
  CAPTION "MFCApp2"
  FONT 8, "MS Shell Dlg", 0, 0, 0x1
  BEGIN
      DEFPUSHBUTTON   "OK",IDOK,46,64,50,14
      PUSHBUTTON      "Cancel",IDCANCEL,109,65,50,14
      CONTROL         "Check1",IDC_CHECK1,"Button",BS_AUTO3STATE | WS_TABSTOP,51,17,39,10
      CONTROL         "Check2",IDC_CHECK2,"Button",BS_AUTO3STATE | WS_TABSTOP,51,39,39,10
  END
  </code></pre>
  
  <p>Any suggestions would be helpful.</p>
  
  <p>UPDATE2:</p>
  
  <pre><code>Resource.h of App1
  #define IDD_MFCAPP1_DIALOG              102
  #define IDR_MAINFRAME                   128
  #define IDC_BUTTON_CHANGE               1000
  
  // Next default values for new objects
  // 
  #ifdef APSTUDIO_INVOKED
  #ifndef APSTUDIO_READONLY_SYMBOLS
  #define _APS_NEXT_RESOURCE_VALUE        129
  #define _APS_NEXT_COMMAND_VALUE         32771
  #define _APS_NEXT_CONTROL_VALUE         1001
  #define _APS_NEXT_SYMED_VALUE           101
  #endif
  #endif
  </code></pre>
  
  <p>and Resource.h of App2 respectively</p>
  
  <pre><code>#define IDD_MFCAPP2_DIALOG              202
  #define IDR_MAINFRAME                   228
  #define IDC_CHECK1                      2000
  #define IDC_CHECK2                      2001
  
  // Next default values for new objects
  // 
  #ifdef APSTUDIO_INVOKED
  #ifndef APSTUDIO_READONLY_SYMBOLS
  #define _APS_NEXT_RESOURCE_VALUE        229
  #define _APS_NEXT_COMMAND_VALUE         32771
  #define _APS_NEXT_CONTROL_VALUE         2002
  #define _APS_NEXT_SYMED_VALUE           201
  #endif
  #endif
  </code></pre>