现在的位置: 首页 > 自动控制 > 工业·编程 > 正文

使用AutoIT调用dll

2013-07-18 06:58 工业·编程 ⁄ 共 547字 ⁄ 字号 暂无评论

AutoIt Version: 3.3.8.1 
Author:         Tody Guo 
 
Script Function: 
    DllCall function test from dll, and the dll file is complied by GCC 
 
#ce ---------------------------------------------------------------------------- 
 
; Script Start - Add your code below here 
 
 
$return=DllCall("dlltest.dll", "str", "pTest"); 
 
if @error = 0 Then 
   MsgBox(48, "Ok", $return[0]) 
EndIf 

gcc --shared -o dlltest.dll dlltest.c

#include <stdio.h> 
 
char *pTest(void) 

    printf("Here comes a good news from dlltest\r\n"); 
     
    return "String from dlltest"; 

use SciTE editor complied au3 file.
comes a function invoke is ok.

给我留言

留言无头像?