-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GdipGetLineColors has different call signatures for 32-bit versus 64-bit #18
Comments
I see how the current definition is wrong, but not how that would be right? gdiplusflat.h: GpStatus WINGDIPAPI
GdipGetLineColors(GpLineGradient *brush, ARGB* colors);
//gdipluspixelformats.h
typedef DWORD ARGB; So the definition should be the same in both, |
Oh, that's strange! You are right that: Public Declare PtrSafe Function GdipGetLineColors Lib "gdiplus" (ByVal brush As LongPtr, colors As Long) As GpStatus ...works for both! But the two-color argument version does "seem" to work for 64-bit and not 32-bit! Here is a snippet: Dim Values(0 To 1) As Long
If GdipGetLineColors(BrushHandle, Values(0), Values(1)) = 0& Then Maybe the second argument is superfluous and gets ignored? Thanks! |
Yeah, that is what it is... here is a test in tB which fails in 32-bit but works in 64-bit. Not sure what the expected behavior is (don't have VB6 to test). Private Declare PtrSafe Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" ( _
ByRef Destination As Any, _
ByRef Source As Any, ByVal Length As Long, _
ByVal superfluous As Long) '<-- added an unsupported argument
Sub test()
Dim a As Long, b As Long
a = 1: b = 2
CopyMemory a, b, 4, 99999 '<-- fails in 32-bit tB with "Bad DLL Definition"
Debug.Print a 'prints 2 in 64-bit tB
End Sub |
Well as long as the new version works in both 32bit and 64bit, I'll leave why the superfluous parameter works in 64bit as a mystery for those more familiar with the calling conventions on a low level. Fixed in v7.8.379, available now. Sorry for the multiple GDIP bugs; thanks for helping make WinDevLib better by reporting them though 👍 |
I've confirmed that the 32- and 64-bit versions have different call signatures by using both in tB (and of course they are not interchangeable). The 32-bit version requires a Long array of dimension 2 (Colors(0) and Colors(1)).
Thx!
The text was updated successfully, but these errors were encountered: