Sign in to follow this  
Followers 0
JohnWang

DllOpen always return -1 for certain Dll files

4 posts in this topic

Hello,

I am trying to use some function in MediaInfo.dll specifically the Inform function to get video bitrate. However, Dllopen function seems to always return -1. I have searched the forum and most people does not have problem using it and is incorporated in many scripts. I have redownloaded the dll file from another source but still the same thing. Here's the the test code I used: (I made sure MediaInfo.dll was located in C:\)

Dim $MediaInfo = @ScriptDir & "\Tools\MediaInfo\"

Func GetBitrate($iFile)
    Dim $MediaInfoDll = DllOpen("C:\MediaInfo.dll")
    MsgBox(0,"Error", $MediaInfoDll)
EndFunc   ;==>GetBitrate

GetBitrate("C:\Test1.mp4")

The return is always -1, I didn't try dllcall yet because dllOpen wouldn't work correctly, and Dllcall looks a bit complex to try to debug. Thanks.

Share this post


Link to post
Share on other sites



I think the dll is a 32-bit dll. If you are working on a 64bit-Machine, you have to take care and execute AutoIt as 32bit, too. Otherwise the script won't be able to open the DLL.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

I think the dll is a 32-bit dll. If you are working on a 64bit-Machine, you have to take care and execute AutoIt as 32bit, too. Otherwise the script won't be able to open the DLL.

YES! That's exactly the problem, I just figured it out as well. Thanks for the prompt reply!

Share this post


Link to post
Share on other sites

I solved that problem... hmmmm, 3 times :blink:? After the last time I ran into that error I added this to the top of my script:

If @AutoItX64 Then
    MsgBox(0, "Error", "SMF won't run as x64 => 32bit dll")
    Exit
EndIf

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0