Calling Function in DLL on Windows

Robin Becker robin at jessikat.demon.co.uk
Thu Jun 1 03:04:44 EDT 2000


In article <3935F38E.FF0061DC at sightreader.com>, Ken Seehof
<12klat at sightreader.com> writes
>dsavitsk wrote:
>
>> i need to call a DLL from within a python program. in VB i would declare the
>> function like...
>>
>> Declare Function LoadSFW Lib "Sfwlnk32" (ByVal strPath As String, ByVal
>> strConfig As String) As Long
>>
>> then use it later like...
>>
>> intErrorCode = LoadSFW("C:\SFW", 6)
>>
>> i don't know how to do this in Python, so any quick explanation would be
>> helpful.
>>
>> doug

try Sam Rushing's windll/calldll stuff; should be findable at medusa

>I don't know of any easy way to do it.  The hard way to do it would be to
>write an extension module that wraps your DLL function(s).  If you don't
>know how to do this, read about "Extending Python".  If you don't know
>C or C++, I'm afraid you are probably out of luck until someone implements
>a generic solution....
>
>Here's an interesting project for Windows programmers: Write a general
>purpose DLL caller.  Functions should be declared in python (like in VB)
>and the DLL should be accessible from python without requiring the user
>to write any C code.  This is doable (VB does it).  The hard part will be
>converting the DLL function arguments.
>
> - Ken Seehof
>
>

-- 
Robin Becker



More information about the Python-list mailing list