Thema: Delphi c++ zu Delphi Callback

Einzelnen Beitrag anzeigen

Benutzerbild von dtpfl
dtpfl

Registriert seit: 19. Jan 2018
Ort: Bayern
20 Beiträge
 
Delphi 12 Athens
 
#1

c++ zu Delphi Callback

  Alt 11. Jan 2023, 14:04
Hallo :=)

Ich darf mal wieder eine Schnittstelle bauen.
jetzt komme ich nicht wirklich weiter :/

C Header
Code:
/* this defines the signature of the call back function that will be called from PEPPERerface to the POS */
#define PEPCallbackSignature                                                                                          \
    void ( *pepCallback )( PEPCallbackEvent /* eEvent */, PEPCallbackOption /* eOption */, PEPHandle /* hInstance */, \
                           PEPHandle /* hOutputOptions */, PEPHandle /* hInputOptions */, void* /* pUserData */ )
Mein Ansatz in Delphi
Code:
//Die beiden musste ich noch deklarieren, andere typen wie PEPHandle habe ich bereits erfolgreich in Delphi implementiert
type PEPCallbackEvent = Pointer;
type PEPCallbackOption = Pointer;

type PEPCallbackSignature = procedure(eEvent: PEPCallbackEvent; eOption: PEPCallbackOption; hInstance: PEPHandle;
                                      hOutputOptions: PEPHandle; hInputOptions: PEPHandle; pUserData: Pointer);
Mehr Info habe ich leider in keiner Dokumentation gefunden, wie konvertiere ich das am besten von C -> Delphi, war mein Ansatz einigermaßen korrekt?
Vielen Dank!
Miniaturansicht angehängter Grafiken
image1.png   image.png  
Delphi-Community Discord:
https://discord.com/invite/c382VBk
  Mit Zitat antworten Zitat