AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Direct2D Anwendung

Ein Thema von BRobby · begonnen am 6. Jun 2025 · letzter Beitrag vom 16. Jun 2025
Antwort Antwort
Seite 2 von 3     12 3      
pcoder

Registriert seit: 29. Mai 2025
5 Beiträge
 
#11

AW: Direct2D Anwendung

  Alt Gestern, 19:09
@Kas Ob.
Also nur eine Pascal declaration order (VTable) kann korrekt funktionieren, aber welche?
Für IDWriteFontSet1 gibt es nun noch eine weitere Variante hier

Delphi-Quellcode:
    function GetFilteredFonts(const {count: indexCount} indices: PUInt32; indexCount: UInt32; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
    function GetFilteredFonts(const {count: fontAxisRangeCount} fontAxisRanges: PDWRITE_FONT_AXIS_RANGE; fontAxisRangeCount: UInt32; selectAnyRange: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
    function GetFilteredFonts(const {count: propertyCount} properties: PDWRITE_FONT_PROPERTY; propertyCount: UInt32; selectAnyProperty: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
  Mit Zitat antworten Zitat
Benutzerbild von gubbe
gubbe
Online

Registriert seit: 8. Okt 2005
Ort: Schleswig-Holstein
163 Beiträge
 
Delphi 12 Athens
 
#12

AW: Direct2D Anwendung

  Alt Gestern, 19:57
Für IDWriteFontSet1 gibt es nun noch eine weitere Variante hier
Das wird automatisch generiert aus den Windows Metadata (winmd) Informationen von Microsoft. Gibt es auch von Embarcadero, wie ich schon weiter oben schrieb über GetIt (Windows API from WinMD).
Eigentlich sollte ja hier die Reihenfolge stimmen. Warum weicht das trotzdem ab von der hier im Thread als korrekt angegebenen Variante?
  Mit Zitat antworten Zitat
pcoder

Registriert seit: 29. Mai 2025
5 Beiträge
 
#13

AW: Direct2D Anwendung

  Alt Gestern, 21:15
Offenbar gibt es hier im Forum keinen offiziellen Delphi Support. Etwas überraschend,
wenn man bedenkt daß die Verwendung von COM interfaces eine sehr grundlegende Sache ist.
Und WindowsAPIfromWinMD (via GetIt) ist nicht vorhanden in Delphi CE12.1.
  Mit Zitat antworten Zitat
Benutzerbild von gubbe
gubbe
Online

Registriert seit: 8. Okt 2005
Ort: Schleswig-Holstein
163 Beiträge
 
Delphi 12 Athens
 
#14

AW: Direct2D Anwendung

  Alt Heute, 07:42
Offenbar gibt es hier im Forum keinen offiziellen Delphi Support. Etwas überraschend,
wenn man bedenkt daß die Verwendung von COM interfaces eine sehr grundlegende Sache ist.
Und WindowsAPIfromWinMD (via GetIt) ist nicht vorhanden in Delphi CE12.1.
Was erwartest Du hier? Offiziellen Delphi-Support in einem Community-Forum?

Ok, wenn es das Paket nicht bei GetIt für die Community-Edition gibt (warum auch immer), hast Du ja eine Alternative gefunden.
  Mit Zitat antworten Zitat
pcoder

Registriert seit: 29. Mai 2025
5 Beiträge
 
#15

AW: Direct2D Anwendung

  Alt Heute, 08:04
Ich erwarte korrekte Interface-Deklarationen für Alle Delphi Nutzer. Punkt!
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
442 Beiträge
 
#16

AW: Direct2D Anwendung

  Alt Heute, 08:49
@Kas Ob.
Also nur eine Pascal declaration order (VTable) kann korrekt funktionieren, aber welche?
Für IDWriteFontSet1 gibt es nun noch eine weitere Variante hier

Delphi-Quellcode:
    function GetFilteredFonts(const {count: indexCount} indices: PUInt32; indexCount: UInt32; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
    function GetFilteredFonts(const {count: fontAxisRangeCount} fontAxisRanges: PDWRITE_FONT_AXIS_RANGE; fontAxisRangeCount: UInt32; selectAnyRange: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
    function GetFilteredFonts(const {count: propertyCount} properties: PDWRITE_FONT_PROPERTY; propertyCount: UInt32; selectAnyProperty: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1): HRESULT; stdcall; overload;
Strangely enough it seems Rust guys ditched this IDWriteFontSet1 altogether

I am not sure what exactly is your question, so sorry, but if you asking about the correctness of the implementation and VTable layout, then using the header file lets say from https://github.com/apitrace/dxsdk/bl....h#L3053-L3099 will be correct as long as you are using Visual Studio compiler, but as i listed few example earlier and how even Rust struggling to fix this mess, as suggested a correct layout and re-ordering of these overloaded interface methods that will fic this once and for all.
And the correct order for Pascal/Delphi and Rust and any other compiler or language (as long it will not act like VS compiler and switch order) should be as posted before this one :
Delphi-Quellcode:
    function GetFilteredFonts(indices: UINT32;
                              indexCount: UINT32;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(properties: PDWRITE_FONT_PROPERTY;
                              propertyCount: UINT32;
                              selectAnyProperty: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;

    function GetFilteredFonts(fontAxisRanges: DWRITE_FONT_AXIS_RANGE;
                              fontAxisRangeCount: UINT32;
                              selectAnyRange: BOOL;
                              out filteredFontSet: IDWriteFontSet1): HResult; overload; stdcall;
Simply order-reverse overloaded methods at first occurrence, of course if they are scattered between other methods then group them at first occurrence.

The header mentioned at https://www.winsoft.sk/win32api.htm is wrong and doesn't comply with Windows SDK, so i will assume someone might tried one function and only fixed it by shuffling them and didn't try the others, or just gave up, the order is wrong and look like this
Delphi-Quellcode:
    procedure GetFilteredFonts(const {count: indexCount} indices: PUInt32; indexCount: UInt32; out {COM out pointer} filteredFontSet: IDWriteFontSet1); safecall; overload;
    procedure GetFilteredFonts(const {count: fontAxisRangeCount} fontAxisRanges: PDWRITE_FONT_AXIS_RANGE; fontAxisRangeCount: UInt32; selectAnyRange: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1); safecall; overload;
    procedure GetFilteredFonts(const {count: propertyCount} properties: PDWRITE_FONT_PROPERTY; propertyCount: UInt32; selectAnyProperty: BOOL; out {COM out pointer} filteredFontSet: IDWriteFontSet1); safecall; overload;
Kas
  Mit Zitat antworten Zitat
TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.077 Beiträge
 
Delphi 10.4 Sydney
 
#17

AW: Direct2D Anwendung

  Alt Heute, 09:55
I think the problem with the MfPack translations is that at some point they took the order from the MSDN website (or auto-generated documentation) instead of using the real header files from the Windows SDK one-to-one.
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
442 Beiträge
 
#18

AW: Direct2D Anwendung

  Alt Heute, 10:15
I think the problem with the MfPack translations is that at some point they took the order from the MSDN website (or auto-generated documentation) instead of using the real header files from the Windows SDK one-to-one.
No, the problem is not that, Windows SDK header and the documentation are correct and identical, the problem exist in Microsoft compiler and undocumented behaviour, this is what cause this mess, the compiler rearrange VTable layout at its own, hence producing its own layout that will work and always work with the same headers, the problem is different compilers will follow strict layout and this layout doesn't with the binary produced by lets say VS compiler, but all these headers belong to Windows components that produced by that quirky compiler and hence all other compilers need to adjust their own header to make their own binary compatible with these shipped with/for Windows, in this case Media Foundation and DirectX ( yes Direct3d and DirectDraw both suffer from this very strange binary when it comes to overloaded interface methods)
Kas
  Mit Zitat antworten Zitat
pcoder

Registriert seit: 29. Mai 2025
5 Beiträge
 
#19

AW: Direct2D Anwendung

  Alt Heute, 13:42
using the real header files from the Windows SDK one-to-one.
Im SDK header (.h) file gibt es keine Beschreibung der ABI-Reihenfolge, kann deshalb nicht! verwendet werden.
  Mit Zitat antworten Zitat
TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.077 Beiträge
 
Delphi 10.4 Sydney
 
#20

AW: Direct2D Anwendung

  Alt Heute, 14:41
Ach du Scheiße, es stimmt.
Dann ist ja auch gar nichts Verlass und der Aufruf von COM-Interfaces vom Windows Betriebssystem Komponenten mit überladenen Methoden ist mehr oder weniger zufällig:

https://learn.microsoft.com/en-us/an...svgelement-api
https://github.com/FactoryXCode/MfPack/issues/4
https://github.com/microsoft/win32metadata/issues/600 (check kennykerrs Antwort)
https://github.com/microsoft/win32metadata/issues/815
https://stackoverflow.com/questions/...-the-same-name
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 3     12 3      

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz