layer Posted February 21, 2005 Share Posted February 21, 2005 (edited) i made my first dll and it compiled fine, no errors, i got the dll, and when i test it, like so, it doesnt work Dllmain.cpp:expandcollapse popup/* Replace "dll.h" with the name of your header */ #include "dll.h" #include <windows.h> DllClass::DllClass() { } DllClass::~DllClass () { } BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ , DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ) { switch (reason) { case DLL_PROCESS_ATTACH: break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } /* Returns TRUE on success, FALSE on failure */ return TRUE; } __declspec(dllexport) int Add (int a, int b) { return(a + b); }Dll.h:#ifndef _DLL_H_ #define _DLL_H_ #if BUILDING_DLL # define DLLIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DLLIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ class DLLIMPORT DllClass { public: DllClass(); virtual ~DllClass(void); private: }; #endif /* _DLL_H_ */AutoIt DllCall test:$add= DllCall ("Add.dll", "int", "Add", "int", 1, "int", 2) MsgBox (4096, "Testing Add.dll", $add) ;Even tried: $add= DllCall ("Add.dll", "int", "Add", "int", 1, "int", 2) MsgBox (4096, "Testing Add.dll", $add[0])could someone please assist me on this, i know it's probably all wrong and everything, even though it is very basic and simple.. pleASE?!! thanks..EDIT: almost forgot, the Dll file itself... and also, i compiled it with Dev-C++ 4.9.9.1.. Edited February 21, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
Josbe Posted February 21, 2005 Share Posted February 21, 2005 Try:extern "C" __declspec(dllexport)...And:$add= DllCall ("Add.dll", "int", "Add", "int", 1, "int", 2) MsgBox (4096, "Testing Add.dll", $add[0])Btw, this isn't a forum for general support. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
layer Posted February 21, 2005 Author Share Posted February 21, 2005 yayayayayaya my first Dll! thanks a million josbe !!! well,better go post this sucker in the Scripts n' Scrapts (even if it is like reallllllly simple, its my first Dll, and im poroud) and about the this isnt a support forum, i just thought i'd ask here because it was for C++ but next time ill post in the support section and thanks a million a million times josbe !! FootbaG Link to comment Share on other sites More sharing options...
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