title: How to use P\Invoke in VB.Net
body: <p>I have number of C++ API's and I want to access them using P\Invoke in VB.Net.Following are the C wrapper written for some of the API's.Can anybody tell me how to use P\Invoke to access these methods in VB.Net.</p>
  
  <p>In wrapper.h:</p>
  
  <pre><code>typedef void * VERIFY_HANDLE;
  extern VERIFY_HANDLE Verify_Create();
  extern void VERIFY_SetVerified(VERIFY_HANDLE, bool);
  extern bool VERIFY_GetVerified(VERIFY_HANDLE);
  /* etc, etc */
  </code></pre>
  
  <p>In wrapper.c:</p>
  
  <pre><code>#include "wrapper.h"
  #include "Verify.h"
  VERIFY_HANDLE Verify_Create() { return (VERIFY_HANDLE) new Verify(); }
  void SetVerified(VERIFY_HANDLE h, bool b) { ((Verify *)h)-&gt;SetVerified(b); }
  bool GetVerified(VERIFY_HANDLE h) { return ((Verify *)h)-&gt;GetVerified();  }
  </code></pre>