title: Class is not available in this context because it is Friend
body: <p>I am trying to create an instance of a legacy c++ class in VB.NET.  I have followed the instructions on the following webpage: <a href="http://windowsdevcenter.com/pub/a/dotnet/2004/03/29/mcpp_part3.html?page=2" rel="nofollow">http://windowsdevcenter.com/pub/a/dotnet/2004/03/29/mcpp_part3.html?page=2</a></p>
  
  <p>1) Created a Visual C++ project with one file (MFoo.cpp) and the following code:</p>
  
  <pre><code>class Foo 
  { public: 
  // constructor 
  Foo(void) {} 
  // destructor 
  ~Foo(void) {} 
  // some method 
  void DoSomeFoo(){} }; 
  
  __gc class MFoo 
  { public: Foo * _foo; 
  public: 
      // constructor 
      MFoo() { _foo = new Foo();} 
      // destructor 
      ~MFoo() { delete _foo; } 
      // method 
      void ManagedDoSomeFoo() { _foo-&gt;DoSomeFoo(); } };
  </code></pre>
  
  <p>2) Built the project in Visual C++ producing a DLL
  3) Created a reference to the DLL (created in part 2) in a VB.NET application</p>
  
  <p>I now get an error when I try to create an instance of the C++ object i.e. Dim foo As New MFoo.  The error is: MFoo is not available in this context because it is Friend.</p>