title: P/Invoke from C#: Call functions of returned object
body: <p>I have a native/unmanaged DLL and it has a "CreateObject" function which returns a pointer to the business object.. so the call would be sth. like:</p>
  
  <pre><code>[DllImport("MyDll.dll", CharSet = CharSet.Auto)]
  private static extern IntPtr CreateObject();
  </code></pre>
  
  <p>Question:
  The object is exposing public-functions like "Connect()" which i want to call, but i don't know how to "map" these calls so i have a simple method-signature like:</p>
  
  <pre><code>private bool Connect();
  </code></pre>
  
  <p>Any ideas?</p>