Author Topic: Delphi sample code  (Read 15698 times)


  • Administrator
  • Jr. Member
  • *****
  • Posts: 49
    • View Profile
Delphi sample code
« on: October 18, 2010, 18:59:42 »
Every once in a while we get a question about Delphi support.  We recently released a new Universal API (DLL) that supports all of our PC Watchdog boards (except the ISA) and we do have samples in "C" (console AP), VB.Net and VB6. As of yet there is no sample Delphi code. We have been asked about the calling convention of the API (DLL) and here is our answer:

The API uses the WINAPI (Pascal) calling convention. Here are samples from the
.h and VB files to call the GetDeviceInfo function:

// .h sample
// #define WDOG_UNIVRSL_API   __declspec(dllimport)
// ------------------------------------------
// Get Info from board
        WD_HANDLE wdHandle, UINT32* pStat, \
                      UINT32* pDipSw, UINT32* pVer, UINT32* pTick, UINT32* pDiag);

' VB sample
' ----------------------------------------
' Get Info from board
Public Declare Function WD_GetDeviceInfo Lib "WDog_Univrsl.dll" (ByVal wdHandle As Integer, _
            ByRef pStat As Integer, ByRef pDipSw As Integer, ByRef pVer As Integer, _
            ByRef pTick As Integer, ByRef pDiag As Integer) As Integer

« Last Edit: October 18, 2010, 19:13:08 by Admin »