title: Translate C++ to Delphi, or convert to a dll
body: <p>I am trying to connect to a Graphtec plotter through a USB port in Delphi.  The following snipet of C++ code is provided by the manufacturer:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  
  typedef HANDLE (APIENTRY *PROC_GITK_OPENUSB)(int, int, DWORD);
  
  int main(int argc, char* argv[])
  {
      HMODULE hUsbLib = LoadLibrary("GITKUSBP.DLL");
  
      PROC_GETK_OPENUSB lpfnGITK_OpenUsb = (PROC_GITK_OPENUSB)GetProcAddress(hUsbLib,            "GITK_OpenUsb");
  
      HANDLE hWrite = (lpgnGITK_OpenUsb)(0, 0, FILE_FLAG_OVERLAPPED);
      HANDLE hRead  = (lpgnGITK_OpenUsb)(0, 1, FILE_FLAG_OVERLAPPED);
  
      OVERLAPPED WriteEvt, ReadEvt;
  }
  </code></pre>
  
  <p>There is more to it, of course, but this appears to be the critical code.  In Delphi, I am not successful with attempts to translate.  I either need some expertise on translation, or some guidance on converting the C++ code into a dll that I can call from Delphi.</p>