title: How does visual studio associate mfc dialog classes with dialog resources?
body: <p>I was wondering how <strong>Visual Studio</strong> associates <code>MFC CDialog</code> derived classes with their corresponding dialog resources. I'm not interested in how the connection is made at run time (as asked <a href="https://stackoverflow.com/questions/348807/mfc-connecting-a-dialog-to-a-dialog-class">here</a>), but rather at design time.</p>
  
  <p>When I add a message handler to a dialog, how does it know which class to add the handler to.
  Also, is it possible to have several <code>CDialog</code> derived classes associated with the same dialog resource and vice versa?</p>
  
  <p>I have searched the project directory for the <code>IDD_SOMEDIALOG</code> string but have only found it in <code>SomeDialog.h</code>, <code>resource.h</code> and <code>Project.rc</code> in the expected places so I guess it somehow deduces the connection from those files, most likely the enum in <code>SomeDialog.h</code>:</p>
  
  <pre><code>// in class CSomeDialog:
      enum { IDD = IDD_SOMEDIALOG };
  </code></pre>
  
  <p>I'm asking this mostly out of curiosity.</p>