Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Are any of the parameters in add-controller or add-tuner actually return values?</p> <p>Strongly recommend that you define prototypes of your functions, rather than calling them direct with casts of all the parameters.</p> <p><a href="http://docs.python.org/library/ctypes.html" rel="nofollow noreferrer">I'm sure you've read this page already</a>, but the section you want to look at is Function Prototypes. Makes the code much cleaner and easier to trace/debug.</p> <p>Also -- as Mark Rushakoff mentions too -- using pointer(c_double()) and like in your call is pretty icky. I have much better luck w/ POINTER(), and recommend again that you predeclare the value as a variable, and pass the variable in your function call. Then at least you can examine its value afterward for strange behavior.</p> <p>EDIT: So your prototype and call will look something like this:</p> <pre><code>prototype = WINFUNCTYPE( c_int, # Return value (correct? Guess) c_short, # tuner_number c_char_p, # file_path c_char_p, # name c_int, # 0? c_int, # 0? c_long, # 0? c_short, # serial_number c_char_p, # error_string ) # 1 input, 2 output, 4 input default to zero (I think; check doc page) paramflags = (1, 'TunerNumber' ), (1, 'FilePath' ), (1, 'Name' ), ... AddController = prototype(('add_controller', WinDLL.MlibTuners), paramflags) </code></pre> <p>Then your call is much cleaner:</p> <pre><code>arg1 = 0 arg2 = 0 arg3 = 0 AddController(tuner_number, self.file_path, name, arg1, arg2, arg3, serial_number, self.error_string) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload