Skip to content

Conversation

@RBetting77
Copy link

Here's one example of how the implementation is wrong.

My change works as it should.

The original declaration comes with "D2D DEBUG ERROR - An interface [0019F388] not allocated by this DLL was passed to it."

GetPixelSize is a stdcall function.
stdcall pushes the parameters to the stack and returns the result in EAX.
In your implementation a (semi) random value from the stack is used as the parameter, the D2D DEBUG ERROR is correct about it not being an interface allocated by this DLL.

Same goes for GetSize and GetPixelFormat in this ID2D1Bitmap interface.

The interfaces are off, this is just one example
@RBetting77
Copy link
Author

By editing the wrong line, committing it, fixing it and committing it again maybe the lines I marked are unclear.

Original code:
function GetPixelSize(): TD2D1_SIZE_U; stdcall;

Changed code:
procedure GetPixelSize(out pixelSize: TD2D1_SIZE_U); stdcall;

@CMCHTPC
Copy link
Owner

CMCHTPC commented Jun 15, 2020

This is not a failure by the interface translation itself. It's an compiler issue. See here
https://bugs.freepascal.org/view.php?id=34078.
I'm not sure if this was already solved since the issue is still open. Delphi also has a "bug" here.
I currentyl work on the update of the headers for 10.0.19041.0. So I will also try if the interface is now working or if they need a "work-around".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants