 <p>try simply indicating ctypes the argtypes it takes and the ones it returns:</p> <pre><code>nDll = ctypes.WinDLL('ndll.dll') nDll.restype = ctypes.c_double nDll.argtypes = [ctypes.c_char_p] result = nDll.iptouint("12.345.67.890").value </code></pre> <p>Although, consider these points:</p> <p>1) if, as the name indicates, this converts an IPv4 value s ina string to an Unsigned Int, the return type os not "double" as you say - it would be ctypes.c_uint32 </p> <p>2) Your example value is not a valit IPv4 address, and cannot be converted to a 32 bit integer (neither does it makes sense as a "double" - i.e. a 64 bit floating point number) - it is simply invalid</p> <p>3) You don't need that if you are just trying to have an unsigned 32bit value for an ipv4 address in Python. There are quite a few, very readable, easier, and multiplatform ways to do that with pure python. For example:</p> <pre><code>def iptoint(ip): value = 0 for component in ip.split("."): value &lt;&lt;= 8 #shifts previous value 8 bits to the left, #leaving space for the next byte value |= int(component) # sets the bits for the new byte in the address return value </code></pre> <p><strong>update</strong>: In Python 3.x there is the ipaddress module - <a href="https://docs.python.org/3/library/ipaddress.html" rel="nofollow">https://docs.python.org/3/library/ipaddress.html</a> - which is also available as a pip install for Python 2.x - it can handle this always in the correct way, and works fine with IPv6 as well.</p>