title: Problems using EnterCriticalSection
body: <p>I need to work with array from several threads, so I use CRITICAL SECTION to give it an exclusive access to the data.<br>
  Here is my template:<br></p>
  
  <pre><code>#include "stdafx.h"
  #ifndef SHAREDVECTOR_H
  #define SHAREDVECTOR_H
  
  #include &lt;vector&gt;
  #include &lt;windows.h&gt;
  
  template&lt;class T&gt;
  class SharedVector {
      std::vector&lt;T&gt; vect;
      CRITICAL_SECTION cs;
      SharedVector(const SharedVector&lt;T&gt;&amp; rhs) {}
  public:
      SharedVector();
      explicit SharedVector(const CRITICAL_SECTION&amp; CS);
      void PushBack(const T&amp; value);
      void PopBack();
      unsigned int size() const;
      T&amp; operator[](int index);
      virtual ~SharedVector();
  };
  
  template&lt;class T&gt;
  SharedVector&lt;T&gt;::SharedVector() {
      InitializeCriticalSection(&amp;cs);
  }
  
  template&lt;class T&gt;
  SharedVector&lt;T&gt;::SharedVector(const CRITICAL_SECTION&amp; r): cs(r) {
      InitializeCriticalSection(&amp;cs);
  }
  
  template&lt;class T&gt;
  void SharedVector&lt;T&gt;::PushBack(const T&amp; value) {
      EnterCriticalSection(&amp;cs);
      vect.push_back(value);
      LeaveCriticalSection(&amp;cs);
  }
  
  template&lt;class T&gt;
  void SharedVector&lt;T&gt;::PopBack() {
      EnterCriticalSection(&amp;cs);
      vect.pop_back();
      LeaveCriticalSection(&amp;cs);
  }
  
  template&lt;class T&gt;
  unsigned int SharedVector&lt;T&gt;::size() const {
      EnterCriticalSection(&amp;cs);
      unsigned int result = vect.size();
      LeaveCriticalSection(&amp;cs);
      return result;
  }
  
  template&lt;class T&gt;
  T&amp; SharedVector&lt;T&gt;::operator[](int index) {
      EnterCriticalSection(&amp;cs);
      T result = vect[index];
      LeaveCriticalSection(&amp;cs);
      return result;
  }
  
  template&lt;class T&gt;
  SharedVector&lt;T&gt;::~SharedVector() {
      DeleteCriticalSection(&amp;cs);
  }
  </code></pre>
  
  <p>While compiling I have such a problem for calling <code>EnterCriticalSection(&amp;cs)</code> and <code>LeaveCriticalSection(&amp;cs)</code>:</p>
  
  <pre>
  'EnterCriticalSection' : cannot convert parameter 1 from 
  'const CRITICAL_SECTION *' to 'LPCRITICAL_SECTION'
  </pre>
  
  <p>I do not know what is wrong. May be you can see. Just because I always used it this way and it was alright. <code>windows.h</code> is included</p>