Reading the ADS-DLL version

System requirements:

This program determines the version of the DLL file. 

Unpack the 'BCB: Read DLL version'(ads-dllsample01.exe) sample program.

Reading the ADS-DLL version 1:

The C++ application:

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "AdsDllSampleUnit.h"
#include "c:\TwinCAT\ADS Api\TcAdsDll\Include\TcAdsDEF.h"
#include "c:\TwinCAT\ADS Api\TcAdsDll\Include\TcAdsAPI.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;


//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::GetVersionButtonClick(TObject *Sender)
{
    long    nTemp;
    AdsVersion* pDLLVersion;

    nTemp = AdsGetDllVersion();
    pDLLVersion = (AdsVersion *)&nTemp;

    Label1->Caption=Format("Version:%d, revision:%d, build:%d",
    ARRAYOFCONST(((int)pDLLVersion->version, (int)pDLLVersion->revision, (int)pDLLVersion->build)));
}
//---------------------------------------------------------------------------