can anyone get
Gdip.Tutorial.11 working on AHK 1.1?
it works fine for me using AHK Basic 1.0
looks like this is the relevant section in Gdip.ahk thats failing. maybe something with these DllCalls? Gdip_All fails too
Code: Select all
Gdip_BitmapFromBRA(ByRef BRAFromMemIn, File, Alternate=0)
{
if !BRAFromMemIn
return -1
Loop, Parse, BRAFromMemIn, `n
{
if (A_Index = 1)
{
StringSplit, Header, A_LoopField, |
if (Header0 != 4 || Header2 != "BRA!")
return -2
}
else if (A_Index = 2)
{
StringSplit, Info, A_LoopField, |
if (Info0 != 3)
return -3
}
else
break
}
if !Alternate
StringReplace, File, File, \, \\, All
RegExMatch(BRAFromMemIn, "mi`n)^" (Alternate ? File "\|.+?\|(\d+)\|(\d+)" : "\d+\|" File "\|(\d+)\|(\d+)") "$", FileInfo)
if !FileInfo
return -4
;msgbox, %FileInfo2%`n%info2%`n%fileinfo1% ;// this shows the same in 1.1 and 1.0
hData := DllCall("GlobalAlloc", "uint", 2, "uint", FileInfo2)
pData := DllCall("GlobalLock", "uint", hData)
DllCall("RtlMoveMemory", "uint", pData, "uint", &BRAFromMemIn+Info2+FileInfo1, "uint", FileInfo2)
DllCall("GlobalUnlock", "uint", hData)
DllCall("ole32\CreateStreamOnHGlobal", "uint", hData, "int", 1, "uint*", pStream)
DllCall("gdiplus\GdipCreateBitmapFromStream", "uint", pStream, "uint*", pBitmap)
DllCall(NumGet(NumGet(1*pStream)+8), "uint", pStream)
return pBitmap
}
the msgbox works so i think it must be something on the lines below it
looks like its an ANSI/Unicode thing. it works on AHK 1.1 ANSI