title: Python 3.7 - Passing parameters to DLL using ctypes
body: <p>I have the following code:</p>
  
  <pre><code>num1=10.1234
  int1=10
  ret=GetOutput(int1,num1)
  </code></pre>
  
  <p>The function GetOutput is defined as </p>
  
  <pre><code>def GetOutput(int2, num2):
    lib = ctypes.WinDLL("mydllname.dll")
    prototype = ctypes.WINFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.POINTER(ctypes.c_double * 4096))
    paramflags = (1, "int2",), (1, "num2",),
    GetOutput = prototype(("GetOutput", lib), paramflags)    
    ret=GetOutput(int2, num2)
    return ret
  </code></pre>
  
  <p>i get the following error and I am requesting your kind help. </p>
  
  <pre><code>LP_c_double_Array_4096 instance instead of float
  </code></pre>
  
  <p>If I convert num1 as:</p>
  
  <pre><code>num1=list(range(4096))
  int1=10
  ret=GetOutput(int1,num1)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>LP_c_double_Array_4096 instance instead of list
  </code></pre>
  
  <p>if I convert the num1 into array as follows:</p>
  
  <pre><code>num1=list(range(4096))
  int1=10        
  for item in num1:
      arrayA = array("i", num1)
  ret=GetOutput(int1,arrayA)
  </code></pre>
  
  <p>i get the following errors:</p>
  
  <pre><code>&lt;class 'TypeError'&gt;: expected LP_c_double_Array_4096 instance instead of array.array
  </code></pre>
  
  <p>Please explain as much as possible as I am new to programming and only have very preliminary/basic understanding of OOPS, lists, tuples, pointers etc and no clue about ctypes.</p>
  
  <p>Thanks</p>