I am writing a fully object-oriented rewrite of tic (and friends) GDI+ flat API for AutoHotkey! It is more or less modeled after the C++ wrapper, though I did not directly set out to do that, it has just worked out that way so far. To demonstrate it I will also have a user interface layer that can be used with full support for alpha-blended layered windows. I will have some things I can demonstrate in the very near future, and may even want some beta-testers to help make sure it all works well. Also, the code is heavily commented!
Now, the issue I am having is with this very simple code shown below:
Code: Select all
#include GDIplus.ahk ; tic's version, not my new one
pToken := Gdip_Startup()
GUID := "{633c80a4-1843-482b-9ef2-be2834c5fdd4}"
VarSetCapacity(CLSID, 16,0)
DllCall("ole32\CLSIDFromString", WStr, GUID, Ptr, &CLSID)
retVal := DllCall("gdiplus\GdipCreateEffect", Ptr, &CLSID, PtrP, hEffect)
OutputDebug, status[%retVal%] effect[%hEffect%] error[%A_LastError%]
Gdip_Shutdown(pToken)
I then compiled a new U32 version of AutoHotkey using VS2015, and while the newly compiled version no longer gives me an access violation, instead this test script just gives me a Win32 error status code... well, at least it isn't an access violation. What I don't get is that the exact same call to GdipCreateEffect in the __New method of my base Effect class doesn't... there I get an A-12 DllCall error, meaning it thinks I am missing 12 bytes of parameters to the GdipCreateEffect call? I am not sure why in the test script above I get a Win32 error from GDI+ and the exact same call gives me an A-12 error from AHK in my actual code... some stack cleanup issue perhaps? Sigh.
So, why will this code work on U64 but not on U32/A32... has anyone else had luck getting GDI+ effects to work under 32-bit builds? Yes, I know the effects are a GDI+ v1.1 bit of code only, that is not an issue. However, I would really like to make my GDI+ library work on A32, U32, and U64 versions of AutoHotkey v1.1+ if at all possible!