MediaInfo.DLL not working with 1.14.03 x64 Unicode

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
alllala
Posts: 17
Joined: 03 Apr 2014, 05:04

MediaInfo.DLL not working with 1.14.03 x64 Unicode

18 Apr 2014, 10:44

I never really got to the part with AHK and DLL calls, although I´m used to AHK for quite some time now.

All I want to do is find out out the runtime of an media file like mp4 or mkv. I found some examples using the MediaInfo.dll and DLL calls but they all do not work as expected. I can´t extract any informations with the DLL call.

Code: Select all


PathToMediaInfoDLL := "Path\MediaInfo.dll"
PathToAVIFile := "SomeDir"

hModule := DllCall("LoadLibrary", "str", PathToMediaInfoDLL)  ; Avoids the need for subsequent DllCalls to load the library
 AB:=MediaInfo_DumpInfo(PathToAVIFile)
msgbox, % AB

MediaInfo_DumpInfo(MediaFile := "") {
   Static A      := A_IsUnicode ? "" : "A"
   Static New    := "MediaInfo.dll\MediaInfo" . A . "_New"
   Static Open   := "MediaInfo.dll\MediaInfo" . A . "_Open"
   Static Inform := "MediaInfo.dll\MediaInfo" . A . "_Inform"
   Static Delete := "MediaInfo.dll\MediaInfo" . A . "_Delete"
   hnd           := DllCall(New)
   DllCall(Open, "UInt", hnd, "Str", MediaFile)
   Info          := DllCall(Inform, "UInt", hnd, "UInt", 0, "Str")
   DllCall(Delete, "UInt", hnd)
   Return Info
}

Any Ideas?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: MediaInfo.DLL not working with 1.14.03 x64 Unicode

18 Apr 2014, 19:33

Step 1: Check ErrorLevel after each DllCall. If any are non-zero, troubleshoot, otherwise continue to step 2.
Step 2: Check the return value of each DllCall. Consult the documentation for your DLL to interpret the result.

For example, if ErrorLevel is -3, you're attempting to load a 32-bit DLL into your 64-bit AutoHotkey, which is impossible.
alllala
Posts: 17
Joined: 03 Apr 2014, 05:04

Re: MediaInfo.DLL not working with 1.14.03 x64 Unicode

19 Apr 2014, 09:45

Thank you for your help lexikos.

With your hint I could solve the problem

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, GollyJer, Lamron750 and 254 guests