title: Compiling existing C++ code with /clr and then calling it from C#
body: <p>I have some C++ code:</p>
  
  <pre><code>namespace Compute {
    class __declspec(dllexport) IProgressCB {
    public:
      virtual void progress(int percentCompleted) = 0;
    };
  
    double __declspec(dllexport) compute(IProgressCB *progressCB, ...);
  }
  </code></pre>
  
  <p>from which I create "compute.dll" with "Common Language Runtime Support (/clr)" turned on in Visual Studio 2008.</p>
  
  <p>I want to call this code from C#. </p>
  
  <p>Next I create a C# console application and add compute.dll as a Reference.
  Then I try to subclass/implement IProgressCB:</p>
  
  <pre><code>public class Progress : Compute.IProgressCB
  {
      public void progress(int percentCompleted)
      {
          Console.WriteLine(percentCompleted + "% completed.");
      }
  }
  </code></pre>
  
  <p>However the autocompletion of VS finds the "Compute" namespace but not any classes or functions inside it!? 
  When I try to compile; it complains about IProgressCB not being public.
  If I write public before the declaration of IProgressCB it complains about not being able to derive from sealed type 'Compute.IProgressCB' instead.</p>
  
  <p>What am I doing wrong here?
  I want to take existing C++ code, do no modifications to it, but compile it with /clrc and then use it from C#. Is this not possible?</p>