E1M1 Posted December 23, 2009 Share Posted December 23, 2009 (edited) Following autoit code crashes after I click ok in msgbox.No error's just windows says that my.exe has stopped working... It can't be autoit problem cuz no errors., Iv'e never seen it with dll, actually I've never seen autoit crashing like this. DllCall("testdll.dll","none","SomeFunction","str","test message") DLL file if someone want's to see it. main.h #ifndef __MAIN_H__ #define __MAIN_H__ #include <windows.h> /* To use this exported function of dll, include this header * in your project. */ #ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT __declspec(dllimport) #endif #ifdef __cplusplus extern "C" { #endif void DLL_EXPORT SomeFunction(const LPCSTR sometext); #ifdef __cplusplus } #endif #endif // __MAIN_H__ main.cpp #include "main.h" // a sample exported function void DLL_EXPORT SomeFunction(const LPCSTR sometext) { MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: // attach to process // return FALSE to fail DLL load break; case DLL_PROCESS_DETACH: // detach from process break; case DLL_THREAD_ATTACH: // attach to thread break; case DLL_THREAD_DETACH: // detach from thread break; } return TRUE; // succesful } Edited December 23, 2009 by E1M1 edited Link to comment Share on other sites More sharing options...
Authenticity Posted December 23, 2009 Share Posted December 23, 2009 DllCall("testdll.dll","none:cdecl","SomeFunction","str","test message") ..works? Link to comment Share on other sites More sharing options...
E1M1 Posted December 23, 2009 Author Share Posted December 23, 2009 yes, ty, +1 edited 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