LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Got problem with dll usb/dmx

Hi all,
I use CVI 7.1 and Win XP.

Try to use USB/DMX Interface.

I have write a small program to controll some lights.
For this project i try to use a external DLL and LIB.

the header file looks:
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif

#define FUNCTION __declspec(dllimport)

FUNCTION __stdcall StartDevice();
FUNCTION __stdcall SetData(long Channel, long Data);
FUNCTION __stdcall SetChannelCount(long Count);
FUNCTION __stdcall StopDevice();

#ifdef __cplusplus
}
#endif

But everytime i get the same error message:
4 Project link errors
Undefined symbol '_SetChannelCount@4' referenced in "dmxtest1.c".
Undefined symbol '_StopDevice@0' referenced in "dmxtest1.c".
Undefined symbol '_StartDevice@0' referenced in "dmxtest1.c".
Undefined symbol '_SetData@8' referenced in "dmxtest1.c".

Can anybody help with this?
What can I do?

thanks
0 Kudos
Message 1 of 7
(4,183 Views)
Have you added the .lib (Import library) to your project?
0 Kudos
Message 2 of 7
(4,164 Views)
Hi,
thanksy for your help,
but
yes I added the the .lib file and the .dll is in the \WINDOWS\system.

My function call looks:

int CVICALLBACK dmx (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
Channel = 1;
Data = 100;
Count = 8;
StartDevice;
SetData(Channel, Data);
SetChannelCount(Count);
break;
}
return 0;
}

I don't find the error.
where is it?

I get everytime the Undefined symbol '-StartDevice.....'
message error.

new ideas?

thanks
0 Kudos
Message 3 of 7
(4,162 Views)
Try "StartDevice();" instead of "StartDevice;".
Could you attach an example, so that I could try it out here?
 
0 Kudos
Message 4 of 7
(4,159 Views)
If I try "StartDevice();" instead of "StartDevice;".
I get the message error "missing prototype".

Here is my attached project.
0 Kudos
Message 5 of 7
(4,157 Views)

Something is wrong with your inport library. Good thing is, that you can create a new one from CVI:

 

Open the Header of the DLL (K8062D_DLL.h). Choose "Options->Generate DLL Import Library..." from the menue. Selct the DLL in the next dialog. After that, a  new .lib will be created. use that one instead of the original .lib, and your programm will work. I attached the lib I created.

André

 

0 Kudos
Message 6 of 7
(4,152 Views)
HiAndré,

thanks for your help.

The Software is running.
0 Kudos
Message 7 of 7
(4,102 Views)