/* Описания типов функций ltr212api.DLL */
typedef void (* APIENTRY p_LTR212_GetDllVersion)(LTR212_DLL_VERSION * const DllVersion);
typedef INT (* APIENTRY p_LTR212_Init)(PTLTR212 hnd);
typedef INT (* APIENTRY p_LTR212_IsOpened)(PTLTR212 hnd);
typedef INT (* APIENTRY p_LTR212_Open)(PTLTR212 hnd, DWORD net_addr, WORD net_port, const CHAR *crate_sn, INT slot_num, const CHAR *biosname);
typedef INT (* APIENTRY p_LTR212_Close)(PTLTR212 hnd);
typedef INT (* APIENTRY p_LTR212_CreateLChannel)(INT PhysChannel, INT Scale);
typedef INT (* APIENTRY p_LTR212_CreateLChannel2)(DWORD PhysChannel, DWORD Scale, DWORD BridgeType);
typedef INT (* APIENTRY p_LTR212_SetADC)(PTLTR212 hnd);
typedef INT (* APIENTRY p_LTR212_SetADCExpFlt)(PTLTR212 hnd, const TLTR212_FILTER *firFlt, const TLTR212_FILTER *iirFlt);
typedef INT (* APIENTRY p_LTR212_Start)(PTLTR212 hnd); 
typedef INT (* APIENTRY p_LTR212_Stop)(PTLTR212 hnd); 
typedef INT (* APIENTRY p_LTR212_Recv)(PTLTR212 hnd, DWORD *data, DWORD *tmark, DWORD size, DWORD timeout);
typedef INT (* APIENTRY p_LTR212_ProcessData)(PTLTR212 hnd, const DWORD *src, double *dest, DWORD *size, BOOL volt);
typedef LPCSTR (* APIENTRY p_LTR212_GetErrorString)(INT Error_Code); 
typedef INT (* APIENTRY p_LTR212_Calibrate)(PTLTR212 hnd, BYTE *LChannel_Mask, INT mode, INT reset); 
typedef INT (* APIENTRY p_LTR212_CalcFS)(PTLTR212 hnd, double *fsBase, double *fs);
typedef INT (* APIENTRY p_LTR212_TestEEPROM)(PTLTR212 hnd);  
typedef DWORD (* APIENTRY p_LTR212_CalcTimeOut)(PTLTR212 hnd, DWORD n);
typedef INT (* APIENTRY p_LTR212_ProcessDataTest)(PTLTR212 hnd, const DWORD *src, double *dest, DWORD *size, BOOL volt,DWORD *bad_num);
typedef INT (* APIENTRY p_LTR212_ReadFilter)(CHAR *fname, TLTR212_FILTER *filter);
typedef INT (* APIENTRY p_LTR212_ReadUSR_Clb)(PTLTR212 hnd, TLTR212_USER_TARE_COEFS *coefs);
typedef INT (* APIENTRY p_LTR212_WriteUSR_Clb)(PTLTR212 hnd, const TLTR212_USER_TARE_COEFS *coefs);
typedef INT (* APIENTRY p_LTR212_ReadCodec_Clb)(PTLTR212 hnd, DWORD ch_mask, TLTR212_USER_TARE_COEFS *coefs);
typedef INT (* APIENTRY p_LTR212_Load_Clb)(PTLTR212 hnd);

/* Описания функций ltr212api.DLL */
p_LTR212_GetDllVersion pLTR212_GetDllVersion;
p_LTR212_Init pLTR212_Init;
p_LTR212_IsOpened pLTR212_IsOpened;
p_LTR212_Open pLTR212_Open;
p_LTR212_Close pLTR212_Close;
p_LTR212_CreateLChannel pLTR212_CreateLChannel;
p_LTR212_CreateLChannel2 pLTR212_CreateLChannel2;
p_LTR212_SetADC pLTR212_SetADC;
p_LTR212_SetADCExpFlt pLTR212_SetADCExpFlt;
p_LTR212_Start pLTR212_Start;
p_LTR212_Stop pLTR212_Stop;
p_LTR212_Recv pLTR212_Recv;
p_LTR212_ProcessData pLTR212_ProcessData;
p_LTR212_GetErrorString pLTR212_GetErrorString;
p_LTR212_Calibrate pLTR212_Calibrate;
p_LTR212_CalcFS pLTR212_CalcFS;
p_LTR212_TestEEPROM pLTR212_TestEEPROM;
p_LTR212_CalcTimeOut pLTR212_CalcTimeOut;
p_LTR212_ProcessDataTest pLTR212_ProcessDataTest;
p_LTR212_ReadFilter pLTR212_ReadFilter;
p_LTR212_ReadUSR_Clb pLTR212_ReadUSR_Clb;
p_LTR212_WriteUSR_Clb pLTR212_WriteUSR_Clb;
p_LTR212_ReadCodec_Clb pLTR212_ReadCodec_Clb;
p_LTR212_Load_Clb pLTR212_Load_Clb;

HINSTANCE hDLL212;
//
if((hDLL212=::LoadLibrary(L"ltr212api.dll"))==NULL)
    return -1;
//
/* Адреса функций ltr212api.DLL */
pLTR212_GetDllVersion=(p_LTR212_GetDllVersion)::GetProcAddress(hDLL212,"LTR212_GetDllVersion");
pLTR212_Init=(p_LTR212_Init)::GetProcAddress(hDLL212,"LTR212_Init");
pLTR212_IsOpened=(p_LTR212_IsOpened)::GetProcAddress(hDLL212,"LTR212_IsOpened");
pLTR212_Open=(p_LTR212_Open)::GetProcAddress(hDLL212,"LTR212_Open");
pLTR212_Close=(p_LTR212_Close)::GetProcAddress(hDLL212,"LTR212_Close");
pLTR212_CreateLChannel=(p_LTR212_CreateLChannel)::GetProcAddress(hDLL212,"LTR212_CreateLChannel");
pLTR212_CreateLChannel2=(p_LTR212_CreateLChannel2)::GetProcAddress(hDLL212,"LTR212_CreateLChannel2");
pLTR212_SetADC=(p_LTR212_SetADC)::GetProcAddress(hDLL212,"LTR212_SetADC");
pLTR212_SetADCExpFlt=(p_LTR212_SetADCExpFlt)::GetProcAddress(hDLL212,"LTR212_SetADCExpFlt");
pLTR212_Start=(p_LTR212_Start)::GetProcAddress(hDLL212,"LTR212_Start");
pLTR212_Stop=(p_LTR212_Stop)::GetProcAddress(hDLL212,"LTR212_Stop");
pLTR212_Recv=(p_LTR212_Recv)::GetProcAddress(hDLL212,"LTR212_Recv");
pLTR212_ProcessData=(p_LTR212_ProcessData)::GetProcAddress(hDLL212,"LTR212_ProcessData");
pLTR212_GetErrorString=(p_LTR212_GetErrorString)::GetProcAddress(hDLL212,"LTR212_GetErrorString");
pLTR212_Calibrate=(p_LTR212_Calibrate)::GetProcAddress(hDLL212,"LTR212_Calibrate");
pLTR212_CalcFS=(p_LTR212_CalcFS)::GetProcAddress(hDLL212,"LTR212_CalcFS");
pLTR212_TestEEPROM=(p_LTR212_TestEEPROM)::GetProcAddress(hDLL212,"LTR212_TestEEPROM");
pLTR212_CalcTimeOut=(p_LTR212_CalcTimeOut)::GetProcAddress(hDLL212,"LTR212_CalcTimeOut");
pLTR212_ProcessDataTest=(p_LTR212_ProcessDataTest)::GetProcAddress(hDLL212,"LTR212_ProcessDataTest");
pLTR212_ReadFilter=(p_LTR212_ReadFilter)::GetProcAddress(hDLL212,"LTR212_ReadFilter");
pLTR212_ReadUSR_Clb=(p_LTR212_ReadUSR_Clb)::GetProcAddress(hDLL212,"LTR212_ReadUSR_Clb");
pLTR212_WriteUSR_Clb=(p_LTR212_WriteUSR_Clb)::GetProcAddress(hDLL212,"LTR212_WriteUSR_Clb");
pLTR212_ReadCodec_Clb=(p_LTR212_ReadCodec_Clb)::GetProcAddress(hDLL212,"LTR212_ReadCodec_Clb");
pLTR212_Load_Clb=(p_LTR212_Load_Clb)::GetProcAddress(hDLL212,"LTR212_Load_Clb");
