Satvik Posted November 26, 2016 Posted November 26, 2016 Hi I am trying to open a dll using DLLOpen, however everytime i try to do so the function fails and returns -1 result. I have the dll in the same folder as the auto it script. Local $hDLL = DllOpen("C:\Users\310255155\Downloads\COMMGvv2\commg.dll") DllCall($hDLL, "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0) DllClose($hDLL) MsgBox(0,'result',$hDLL)
JohnOne Posted November 26, 2016 Posted November 26, 2016 Is commg.dll one of those that need to be registered? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Malkey Posted November 27, 2016 Posted November 27, 2016 Using nirsoft's free DLL Export Viewer @ http://www.nirsoft.net/utils/dll_export_viewer.html, I could not find the export function, "MessageBox" in the "commg.dll" file. To dllcall a message box, see the _WinAPI_MessageBoxIndirect function. First, look up _WinAPI_MessageBoxIndirect in the AutoIt help file and try the example, then; Secondly, open the include file, WinAPIDlg.au3, and look at the actual workings of the _WinAPI_MessageBoxIndirect function. You'll see "MessageBoxIndirectW" is the export function used from the "user32.dll" file. Note : The return values of the _WinAPI_MessageBoxIndirect function is the same as the return values of the MsgBox function, which depends on which button is pressed in the message box.
JohnOne Posted November 27, 2016 Posted November 27, 2016 I doubted that messagebox was a real function, but could not be bothered wasting my time because it's DllOpen that is failing. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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