title: win forms C++/CLI How to use .cpp class from header
body: <p>Hello I have sample</p>
  
  <pre><code>#include "stdafx.h"
  using namespace System;
  
  ref class RefClass 
  {
  public:
      int X;
  
      RefClass(int x)
      {
          X = x;
      }
  };
  </code></pre>
  
  <p>How can I use this class in Form1.h? Like <code>RefClass^ d = gcnew WinFormsTest::RefClass();</code></p>
  
  <pre><code>public ref class Form1 : public System::Windows::Forms::Form
  
  private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  
           }
  </code></pre>
  
  <p>2nd Where i should place RefClass code in .h? or .cpp? </p>