Git Product home page Git Product logo

Comments (4)

fafalone avatar fafalone commented on July 19, 2024 1

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 👍

from windevlib.

fafalone avatar fafalone commented on July 19, 2024

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, Public Declare PtrSafe Function GdipGetLineColors Lib "gdiplus" (ByVal brush As LongPtr, colors As Long) As GpStatus because a DWORD is just a 4-byte Long on both 32bit and 64bit.

from windevlib.

GCuser99 avatar GCuser99 commented on July 19, 2024

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!

from windevlib.

GCuser99 avatar GCuser99 commented on July 19, 2024

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

from windevlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.