title: Call C# dll function from C++/CLI
body: <p>I have a <code>C#</code> dll. The code is below: </p>
  
  <pre><code>public class Calculate
  {
      public static  int GetResult(int arg1, int arg2)
      {
          return arg1 + arg2;
      }
  
      public static  string GetResult(string arg1, string arg2)
      {
          return arg1 + " " + arg2;
      }
  
      public static   float GetResult(float arg1, float arg2)
      {
          return arg1 + arg2;
      }
  
      public Calculate()
      {
      }
  }
  </code></pre>
  
  <p>Now, I am planning to call this dll from <code>C++</code> on this way. </p>
  
  <pre><code>[DllImport("CalculationC.dll",EntryPoint="Calculate", CallingConvention=CallingConvention::ThisCall)]
  extern void Calculate();
  
  [DllImport("CalculationC.dll",EntryPoint="GetResult", CallingConvention=CallingConvention::ThisCall)]
  extern int GetResult(int arg1, int arg2);
  </code></pre>
  
  <p>Here is function where is called GetResult </p>
  
  <pre><code>private: System::Void CalculateResult(int arg1, int arg2)
  {
      int rez=0;
  
      //Call C++ function from dll
      Calculate calculate=new Calculate();
      rez=GetResult(arg1,arg2);
  }
  </code></pre>
  
  <p>I got the error :  "syntax error : identifier 'Calculate'". 
  Can someone help me with this terrible error?</p>