FireFox Posted March 8, 2014 Posted March 8, 2014 Hi, I'm trying to create a simple dll which I can call from autoit. After some search I got a simple printf working, but when I try to add some parameters it crashes. #include "stdafx.h" #include <iostream> using namespace std; extern "C" { __declspec(dllexport) void Multiply(int a, int b) { printf("Hello from DLL ! %d\n", a); //return a*b; } } $a = DllCall("MyDLL.dll", "none", "Multiply") ;, "int", 4, "int", 5) ConsoleWrite("error: " & @error & @Lf) If IsArray($a) = 1 Then ConsoleWrite($a[0] & @Lf) Any help will be appreciated. Br, FireFox.
funkey Posted March 8, 2014 Posted March 8, 2014 You need to use cdecl. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
FireFox Posted March 8, 2014 Author Posted March 8, 2014 (edited) Damn, I was sure I tested it... Thanks. Edited March 8, 2014 by FireFox
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now