LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

used external dll with labwindows CVI

Hi,

I'am beginner labwindows (version5.1 under W98).
I use a PC card Axiomtek DASP52032 with 16 Inputs-16 outputs.
it's include example programs for  Delphi, Bcb, Mfc et VB et not CVI
On the Cd,  I find  file  DASP52032r.dll and  files .lib - .h for Bcb et Mfc
but when I compile the error is  :

Abort load of librairy ......
when  I add to project the lib of   directory Borland Bcb

or

Bad header encountered while reading external module
Aborted load of member
Aborted load of library
when I
add to project the lib of   directory microsot mfc

Thank's  for your answer to help me.

Michel


join  .h file where I replace
EXPORT  by  __declspec (dllimport)



/***************************************************************
Copyright (c) 2004 Axiomtek Technology Co. ,Ltd.
Module Name: DASP52032.h v4.4.1.1

Abstract:
Header File of the PCI-52032 Win32 DLL Library

History:
v4.4.1.1 Ben
****************************************************************/
#ifndef __P52032DLL_H__
#define __P52032DLL_H__


// Add-0n Board Common Information
#define NOINTERRUPT -1
#define ANYVALUE 1
#define BOARD_STATUS_FALSE 0x00 // Default Value
#define BOARD_STATUS_TRUE 0xFF
#define BOARD_STATUS_READY 0xFE // Pci card ready for use
#define MAX_ERROR_COUNT 4095 // Timeout Ticks
#define MAX_BOARD_NO 8 // No of the Maximum Board

// Function Declerations
#ifdef __cplusplus
extern "C"
{
#endif
//-------------- Fundamental System Function ----------------------
__declspec (dllimport) DWORD __stdcall DASP52032_QuickInstalled(BYTE id, BYTE res);
__declspec (dllimport) DWORD __stdcall DASP52032_Release(BYTE id);
__declspec (dllimport) DWORD __stdcall DASP52032_GetDeviceStatus(BYTE id, BYTE *sts);
__declspec (dllimport) DWORD __stdcall DASP52032_GetDeviceList(WORD addrs, BYTE *id, BYTE *sts);
__declspec (dllimport) DWORD __stdcall DASP52032_GetPciDeviceList(BYTE *id, DWORD *cardSN, BYTE *sts);
__declspec (dllimport) DWORD __stdcall DASP52032_GetDllVersion(DWORD *var);

//-------------- Digital I/O Function -----------------------------
__declspec (dllimport) DWORD __stdcall DASP52032_ReadGpio(BYTE id, WORD *data);
__declspec (dllimport) DWORD __stdcall DASP52032_WriteGpio(BYTE id, WORD data);
__declspec (dllimport) DWORD __stdcall DASP52032_ReadBackGpio(BYTE id, WORD *data);

#ifdef __cplusplus
}
#endif //__cplusplus

#endif // __H52032DLL_H__
0 Kudos
Message 1 of 3
(3,127 Views)
I am not sure if CVI 5.x supports creating a lib file like mentioned here, Michel.
Using a lib file created by CVI might solve your issue.
0 Kudos
Message 2 of 3
(3,107 Views)
Michel, I forgot to mention:
If you do not succeed in creating a lib file for that DLL: You can use explicit linking
As a result, you do not need a lib file but your C code must call GetProcAddress() for each DLL function that you want to use. See the link to Microsoft's MSDN.
Regards, Guenter
0 Kudos
Message 3 of 3
(3,104 Views)