title: How to make a dictionary of synchronization objects?
body: <p>What I need is something like <code>std::map&lt;std::string, CCriticalSection&gt;</code> but CCriticalSection is non-copyable. Instead of <code>CCriticalSection</code> I thought I could use <code>CRICITAL_SECTION</code> but it's also <a href="https://stackoverflow.com/a/3269274/237483">not possible to copy or move objects of this type</a>. Because it's a very old project, I'm restricted to use MFC and VC6. I would like to access the synchronization objects in following manner (the following code does not work and is just an idea how I would like to use the dicionary):</p>
  
  <pre><code>// global variable
  std::map&lt;std::string, CCriticalSection&gt; csec;
  
  unsigned int somefunc(std::string ip)
  {
      CSingleLock lock(&amp;csec[ip], TRUE);
      // do something
  }
  </code></pre>
  
  <p>So my question is, how to make a dictionary of synchronization objects using MFC and VC6?</p>
  
  <p>Thank you for your answers!</p>