title: C++/CLI .ToString() returning error
body: <p>I am a beginner to C++/CLI as I come from a C# background.  I am currently writing a wrapper for some native C++ code.  I have the following methods:</p>
  
  <pre><code>    void AddToBlockList(System::String^ address)
      {
          char* cAddress = (char*)(void*)Marshal::StringToHGlobalAnsi(address);
          _packetFilter-&gt;AddToBlockList(cAddress);
      }
  
      void AddToBlockList(IPAddress^ address)
      {
          char* cAddress = (char*)(void*)Marshal::StringToHGlobalAnsi(address.ToString());
          _packetFilter-&gt;AddToBlockList(cAddress);
      }
  </code></pre>
  
  <p>...The first method works fine and converts my string into the character array.  However, the second function with the IPAddress object as the signiture gives me the following error:</p>
  
  <blockquote>
  <pre><code>error C2228: left of '.ToString' must have class/struct/union
  </code></pre>
  </blockquote>
  
  <p>...When I type</p>
  
  <pre><code>? address.ToString() 
  </code></pre>
  
  <p>...in the command window, the IP Address prints.  Not sure where I'm going wrong.  Any ideas?</p>