ImageWizard.dll doesn't work in unicode ahk

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

ImageWizard.dll doesn't work in unicode ahk

Post by tmplinshi » 15 Oct 2013, 18:10

Code: Select all

; Works in ANSI

#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

/*
Public Enum IwStatus
   Ok = 0
   LoadingError = 1
   ImageNotInitialized = 2
   InvalidParameter = 3
   BitCountNotSupported = 4
   UnknownImageHandle = 5
   AccessDenied = 6
   UnrecognizedSignature = 7
   OutOfMemory = 8
   GdiplusNotInitialized = 9
   ValueOverflow = 10
   UnknownImageFormat = 11
   Win32Error = 12
End Enum
*/

log .= "`n`n LoadLibrary: " hModule := DllCall("LoadLibrary", Str, "ImageWizard.dll")
log .= "`n`n ImageWizardStartUp: "     DllCall("ImageWizard\ImageWizardStartUp")

; Public Declare Function LoadImageFromFile Lib "ImageWizard.dll" (ByVal FileName As String, ByRef Image As Long, Optional ByVal Index As Long) As IwStatus
log .= "`n`n LoadImageFromFile: "      DllCall("ImageWizard\LoadImageFromFile", Str, "lena.bmp", "Int*", hImage) ; <---- Not work in unicode ahk.
log .= "`n`n hImage: " hImage
log .= "`n`n SaveImageToPngFile: "     DllCall("ImageWizard\SaveImageToPngFile", Int, hImage, Str, "out.png")

; Public Declare Function DisposeImage Lib "ImageWizard.dll" (ByRef Image As Long) As IwStatus
log .= "`n`n DisposeResource: "        DllCall("ImageWizard\DisposeResource", "Int*", hImage) ; <----- Not work.
log .= "`n`n ImageWizardShutDown: "    DllCall("ImageWizard\ImageWizardShutDown")
log .= "`n`n FreeLibrary: "            DllCall("FreeLibrary", UInt, hModule)

MsgBox, 262144, Finish, % log
Above code works in ANSI only. When running in unicode, it will failed at LoadImageFromFile, I've tried the AStr, also not work.

Download:
test files: https://www.dropbox.com/s/a6uto60jd0hej ... eWizard.7z
ImgWizard (Includes source and .chm, etc.): https://www.dropbox.com/s/xudz55yitkqa6vz/ImgWizard.rar

Thanks!

User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: ImageWizard.dll doesn't work in unicode ahk

Post by joedf » 15 Oct 2013, 18:27

Make that ur the correct CPU architecture, x86 or x64 DLL??
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: ImageWizard.dll doesn't work in unicode ahk

Post by tmplinshi » 15 Oct 2013, 20:55

Hi joedf, it's a x86 DLL.

Post Reply

Return to “Ask for Help (v1)”