title: Confused on C++ casting
body: <p>I have been reading a lot about C++ casting and I am starting to get confused because I have always used C style casting.</p>
  
  <p>I have read that C style casting should be avoided in C++ and that reinterpret_cast is very very dangerous and should not be used whenever there is an alternative. On the contrary to not using reinterpret_cast, I have seen it used many times on MSDN in their sample code. This leads me to ask my first question, when is it ok to use reinterpret_cast?</p>
  
  <p>For example:</p>
  
  <pre><code>LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
  {
     switch (Msg)
     {
        case WM_CREATE:
        {
            LPCREATESTRUCT lpCreateStruct = reinterpret_cast&lt;LPCREATESTRUCT&gt;(lParam); 
            return 0;
        }
     }
  
     ...
  }
  </code></pre>
  
  <p>If that is not ok, then how would I cast the LPARAM value to a pointer using only static, dynamic, and/or const casting?</p>
  
  <p>Also: If reinterpret_cast is not portable, how would I rewrite it to be portable (for good practice)</p>