Error trying to use a DllCall

Alles rund um Probleme, Bugs & Fehlermeldungen
Antworten
HenrikR
Beiträge: 3
Registriert: Do 31. Okt 2019, 11:04
Kontaktdaten:

Error trying to use a DllCall

Beitrag von HenrikR » Do 31. Okt 2019, 12:40

Hi

if I use the following code inside ISN it gives me this error,
"Y:\DP\Users\Utils\AutoIT\ItunesRewrite\filesfunction.au3" (397) : ==> Subscript used on non-accessible variable.:
$hMediaInfo = $aMediaInfo[0]
$hMediaInfo = $aMediaInfo^ ERROR
I have tried creating an new project with only this code in it, and it still gives the error.

But if I use it inside Scite it works without problems.

The DLL can be downloaded from here
https://mediaarea.net/download/binary/l ... taller.zip

Any suggestions?

Code: Alles auswählen

Global $FTR_Files[1]
$FTR_Files[0] = "testfile.mov"

CheckAudioMappings($FTR_Files)

Func CheckAudioMappings(ByRef $TempArray)
;~ $hDLL = DllOpen("MediaInfo.dll")
$hDLL = DllOpen("MediaInfo.dll")

; New MediaInfo handle
$aMediaInfo = DllCall($hDLL, "ptr", "MediaInfo_New")
$hMediaInfo = $aMediaInfo[0]
Endfunc

Benutzeravatar
ISI360
Administrator
Beiträge: 222
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von ISI360 » Do 31. Okt 2019, 14:19

Hi

I get the same error in Scite.
Are you sure this dll works with autoit? Even DllOpen("MediaInfo.dll") does return -1 at my test stations?

Maybe the ISN uses a different AutoIt Version than your Scite installation??

HenrikR
Beiträge: 3
Registriert: Do 31. Okt 2019, 11:04
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von HenrikR » Do 31. Okt 2019, 15:15

Hi,

Strange, but it is working perfectly in SciTE4AutoIt3.exe from 02-01-2019 wih Autoit3 v3.3.14.5, I have also installed v3.3.15.0 Beta but I very rarely use it.

I am not the only to use it in Autoit as you can see here.
https://www.autoitscript.com/forum/topi ... iainfodll/

How can I see what version ISN is using, and can I do anything to replace the version in ISN?

Benutzeravatar
ISI360
Administrator
Beiträge: 222
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von ISI360 » Do 31. Okt 2019, 15:36

Hmm..really strange. I well check that on another pc....

You can check the version in the programmsettings of the ISN. (File -> Program Settings -> Program Paths -> Autoit Paths)
The Autoit3.exe is used to test/run scripts.

Benutzeravatar
ISI360
Administrator
Beiträge: 222
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von ISI360 » Do 31. Okt 2019, 15:47

I guess i found the "error": The .dll you provided in the Link is a 64Bit only DLL. And per default the ISN tests/runs Scripts with the normal
AutoIt3.exe...with is 32Bit. And this causes the crash. A 32-bit Autoit can not use a 64-bit Dll.
Maybe your Scite is using the 64bit Version of Autoit.

You have multiple options to solve this:
- Use a 32 Bit Version of your dll
- Simply edit the path to the Autoit3.exe in the ISN Settings to the AutoIt3_x64.exe. (You can find it in C:\Program Files (x86)\AutoIt3)
Then all your script will be executed with the 64-Bit Version of Autoit and it should work as normal.

Hope that helps ;)

HenrikR
Beiträge: 3
Registriert: Do 31. Okt 2019, 11:04
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von HenrikR » Do 31. Okt 2019, 16:42

Hi

Thanks for the help.

I changed from 32bit to 64bit in the settings and now it works.

I had not thought about 32 vs 64 bit at all.

Again thanks. Also really great program.
I do have one small issue, I cannot use GuiRichEdit controls in the GUI editor, or if I can, I am unable to figure it out :D
But apart from that, nothing.

/Henrik

Benutzeravatar
ISI360
Administrator
Beiträge: 222
Registriert: Fr 11. Okt 2013, 13:06
Kontaktdaten:

Re: Error trying to use a DllCall

Beitrag von ISI360 » Do 31. Okt 2019, 17:44

Glad to hear it worked, and thanks for your feedback ;)

PS: GuiRichEdit-Controls are coming with the next update. (1.10)

Antworten