using autoit and ctypes

Jimmy Retzlaff jimmy at retzlaff.com
Wed Nov 19 17:06:59 EST 2003


Rob McMonigal wrote:

> I am using Autoit to do a little gui scripting.  I am currently using
the
> ActiveX version with the win32com package.  I first tried to use the
dll
> version with the ctypes library.  The calls work with the dll version,
but
> I
> always
> get the following error:
> 
> Traceback (most recent call last):
>   File "test.py", line 8, in ?
>     autoit.AUTOIT_WinActivate("Inbox - Microsoft Outlook" , "")
> ValueError: Procedure called with not enough arguments (8 bytes
missing)
> or
> wrong calling convention
> 
> Code is as follows
> --------------------------
> from ctypes import *
> 
> autoit = cdll.LoadLibrary("c:\\autoit\\autoitdll.dll")
> autoit.AUTOIT_WinActivate("Inbox - Microsoft Outlook" , "")
> --------------------------
> 
> Can someone tell me why I'm getting that error?

AutoIt uses the Windows calling convention (as opposed to the C calling
convention) so you should load it like this:

autoit = windll.LoadLibrary("c:\\autoit\\autoitdll.dll")

Jimmy






More information about the Python-list mailing list