Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi REAJET API-DLL in Delphi benutzen (https://www.delphipraxis.net/190434-reajet-api-dll-delphi-benutzen.html)

plutoonline 4. Okt 2016 06:57

REAJET API-DLL in Delphi benutzen
 
Hallo,
wir haben eine Inkjetdrucker der Firma REAJET an einer Produktionslinen.
Ich möchte die Ansteuerung gerne in ein vorhandenes Delphiprogramm integrieren.
Die Firma REAJET stell eine API-DLL zu Verfügung.
Jetzt habe ich das problem, dass ich nur eine Headerdatei für VC++ zu Verfügung habe.
Ich habe jetzt angefangen die Headerdatei für Delphi umzubauen.
Die folgenden 4 Funktionen habe ich auch schon zum Laufen bekommen.
Code:
VC++
REAPI_DLL const char* REAPI_LibInfo( );
REAPI_DLL const char* REAPI_GetRevision( );
EAPI_DLL TConnectionId REAPI_Connect( const char* connectionString );// Connection address string
REAPI_DLL TErrorCode REAPI_Disconnect( TConnectionId connection );// Connection id returned by REAPI_connect
Jetzt habe ich ein Problem mit der nächsten Funktion:
Code:
VC++
REAPI_DLL TErrorCode REAPI_RegisterConnectionCallback(    C_connectionCallbackPtr callback,   // Callback for asynchronous mode
   void* context );                              //Helper Context pointer
Hier muss ein Pointer auf eine Callbackfunktion übergeben werden.
In VC++ würde das ganez so aussehen.

Code:
//Die Callbackroutine

void REAPI onConnectionChanged(TConnectionId con, TConStatus
statusID, TErrorCode error, void * context)
{
{
printf("Connected\n");
GlobalConnectionId = con;
}
else
{
printf("Connection failed\n");
}
}
/*Register ConnectionCallback function in asynchronous mode*/
REAPI_RegisterConnectionCallback ( & onConnectionChange,
&mycontext);
Code:
//Die Registrierung der Callbackroutine[/B]

tmperror = REAPI_RegisterConnectionCallback( &onConnectionChanged, 0 );
Wie kann ich das ganze jetzt auf Delphi Portieren?
Vielen Dank schon mal!


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:46 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz