Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Script won't work after upgrading to windows 10



  • Please log in to reply
3 replies to this topic
Marsiv
  • Members
  • 14 posts
  • Last active: Oct 29 2015 11:59 PM
  • Joined: 05 Jul 2014

Hi guys, 

 

my script stopped working after installing a fresh windows 10 copy.

 

This part is the issue:

PATH_API := RelToAbs(A_ScriptDir, "API.dll")

hModule := DllCall("LoadLibrary", Str, PATH_API)
if(hModule == -1 || hModule == 0)
{
	MsgBox, 48, API - Error, The API.dll could not be found.`nProgram will exit.
	ExitApp
}

ahk.png

 

but the API.dll is in the same directory as the script. And everything worked fine before resetting my windows. (I had Win 7)

 

I am using v1.1.22.07 (ANSI 32-bit) but unicode doesn't work either.

 

What could i else try??



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Try this:
PATH_API := A_ScriptDir "\API.dll"  ; What's RelToAbs?  Just use an absolute path...

hModule := DllCall("LoadLibrary", "str", PATH_API, "ptr")  ; "ptr" optional for 32-bit.
if !hModule  ; "If the function fails, the return value is NULL" (0)
{
	MsgBox, 48, API - Error, Failed to load API.dll; error %A_LastError%.`nProgram will exit.
	ExitApp
}
What's the error code (A_LastError)? Look it up in System Error Codes.

Marsiv
  • Members
  • 14 posts
  • Last active: Oct 29 2015 11:59 PM
  • Joined: 05 Jul 2014

Thank you for your fast reply!

Thats weird:

 

ahk.png

 

Error Code:

error126.png

 

But its right next to the library:

winscr.png

 

 

I guess it's not an issue with AHK but windows 10. If some of you don't know a solution either, please tell me so i can downgrade to Win7 asap.



Marsiv
  • Members
  • 14 posts
  • Last active: Oct 29 2015 11:59 PM
  • Joined: 05 Jul 2014
✓  Best Answer

Got it. Somehow, Microsoft Visual C++ 2010 needs to be installed to run this particular script. 

I gave up and reinstalled Windows 7. After all the procedure i nearly stabbed myself when reading the same error message. Somehow, Win7 told me additionally that the "msvcp110.dll" is missing. 

Someone else in this community once said that Visual C++ would solve the problem and he was right. So im perfectly fine now. (Both Win10 and Win7).

 

You can download it on their official website here:

https://www.microsof...ls.aspx?id=5555

 

And thank you Lexikos, you gave me a hot hint.