J'essaye de faire un dll qui va etre appelee par un script Autoit et je n'arrive pas a executer la fonction dans la dll ca plante a tous les coups
Ci dessous le script
Code : Tout sélectionner
$dll = DllOpen("mydllgcc.dll")
if($dll = -1) then
msgbox(4096,"ret","dll open - ERROR="&@ERROR&@CRLF)
exit
Else
ConsoleWrite("DLL open succesfully"&@CRLF)
EndIf
$var = DllCall($dll,"int","square","int",$var)
if(@ERROR <> 0) then msgbox(4096,"ret","dll exe error="&@ERROR&@CRLF)
Code : Tout sélectionner
int function1(int a)
{
return a*a;
}
int square(int a)
{
return a*a;
}
Code : Tout sélectionner
EXPORTS function1
EXPORTS square
Code : Tout sélectionner
gcc -mno-cygwin -c mydll.c
gcc -shared -mno-cygwin -o mydllgcc.dll mydll.o mydll.def -Wl,--export-all-symbols -Wl,--out-implib=mygccdll.dll.a
Creating library file: mygccdll.dll.a
J'ai aussi essaye de construire la dll avec visual studio express et j'ai le meme probleme.
-winux38