x64 MediaInfo.dll

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

x64 MediaInfo.dll

17 Apr 2017, 05:28

Hi!

Having problems with no videoformat info after upgrading to Win10 x64 using the x64 MediaInfo.dll. Still using 32-bit AHK_H though. Anyone having a clue how to get it working again?

Code: Select all

affected_file := "F:\TV\stuff\recording properties fails\20140429_21-59-04_TV12_Casino Royale - ★★★★★★★★☆☆.ts"
Mediainfo_location := "C:\Program Files\MediaInfo\MediaInfo.dll"
DllCall( "LoadLibrary", Str, Mediainfo_location )
hnd := MediaInfo_New()
MediaInfo_Open( hnd, affected_file )
videoformat := MediaInfo_Get( hnd, 1,0, "Format", 1 )
msgbox % videoformat

MediaInfo_New() {
 Return DllCall( "mediainfo\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_New" )
}
MediaInfo_Open( hnd, MediaFile ) {
 Return DllCall( "mediainfo.dll\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Open", UInt,hnd
               , Str,MediaFile, UInt )
}
MediaInfo_Get( hnd, StrK=0, StrN=0, Comm="", InfK=0, Srch=0 ) {
 Return DllCall( "mediainfo.dll\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Get", UInt,hnd
               , Int,StrK, Int,StrN, Str,Comm, Int,InfK, Int,Sech, Str )
}
MediaInfo_Close( hnd ) {
 Return DllCall( "mediainfo\MediaInfo" ( A_IsUnicode ? "" : "A" ) "_Close", UInt,hnd )
}
just me
Posts: 9456
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: x64 MediaInfo.dll

17 Apr 2017, 06:21

Hello zcooler,

at least, you should define the 'hnd' (handle?) types as "Ptr".
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: x64 MediaInfo.dll

17 Apr 2017, 07:36

Hello just me,

yes, I have already tried changing the 32-bit "Int" to its x64 counterpart "Ptr" inside the MediaInfo_Get() DllCall, but the msgbox is still empty. DllCall conversion is very tricky stuff IMO and Im not entirely sure what im doing :oops:
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
Contact:

Re: x64 MediaInfo.dll

17 Apr 2017, 07:43

Hey,

Does MsgBox %affected_file% display your filename as entered, with the stars? If not, make sure your script is saved as UTF-8/16 with the BOM/signature.
just me
Posts: 9456
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: x64 MediaInfo.dll

17 Apr 2017, 07:49

Code: Select all

; AHK 64-bit is Unicode!
MediaInfo_New() {
 Return DllCall( "mediainfo\MediaInfo_New", "Ptr" )
}
MediaInfo_Open( hnd, MediaFile ) {
 Return DllCall( "mediainfo.dll\MediaInfo_Open", "Ptr",hnd
               , "Str",MediaFile, "UInt") ; not sure about the return type, but it isn't used
}
MediaInfo_Get( hnd, StrK=0, StrN=0, Comm="", InfK=0, Srch=0 ) {
 Return DllCall( "mediainfo.dll\MediaInfo_Get", "Ptr",hnd
               , "Int",StrK, "Int",StrN, "Str",Comm, "Int",InfK, "Int",Sech, "Str" )
}
MediaInfo_Close( hnd ) {
 Return DllCall( "mediainfo\MediaInfo_Close", "Ptr",hnd )
}
?
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: x64 MediaInfo.dll

17 Apr 2017, 08:01

Sorry, when trying it ErrorLevel is still -3 after MediaInfo_Get() call.
Last edited by zcooler on 17 Apr 2017, 08:07, edited 1 time in total.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: x64 MediaInfo.dll

17 Apr 2017, 08:04

qwerty12 wrote:Hey,

Does MsgBox %affected_file% display your filename as entered, with the stars? If not, make sure your script is saved as UTF-8/16 with the BOM/signature.
Hello qwerty12 :) No, the msgbox is empty and script is saved in UTF-8 with BOM yes.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: x64 MediaInfo.dll

17 Apr 2017, 08:11

Yes, I have read this topic and what im trying to attempt is to load a 64-bit DLL into my 32-bit Unicode AutoHotkey_H, which also might be impossible?
just me
Posts: 9456
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: x64 MediaInfo.dll

17 Apr 2017, 08:12

Yes.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: x64 MediaInfo.dll

17 Apr 2017, 08:19

Ok, thanks just me! I will tackle it from the right angle then.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder, roysubs and 282 guests