LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

having problem calling labview dll from CVI 8.1

Hi,
I've a dll writen in labview version 7.1
After reading all the information I found here I'm still having problems.
I've a function in the dll that receive this argument: LStrHandle *name
I assume that name is a string and from the information I found here this is what I should do in CVI:
char str[50];
LStrHandle *name;
 
*name=(LStrHandle)DSNewHandle(sizeof(int32)+strlen(str)*sizeof(uChar));
 memcpy(LStrBuf(**name),str,strlen(str));
 LStrLen(**name)=strlen(str);
 
First problem: I get link error for DSNewHandle
Second problem is that I try to install labview 7.1 runtime engine and I get an error that a higher version is already installed
 
Thanks
 
 
0 Kudos
Message 1 of 4
(3,600 Views)
Hi,

To be able to use the DSNewHandle function in CVI you have to link to the LabVIEW.lib file and add the extcode.h header file.  Both of these files are located under the LabVIEW directory, then under cintools.  Add both of these files to your project and it should remove the link error.

Also, since you already have a newer version of the run-time engine on your computer, you do not need to install the 7.1 run-time engine.
0 Kudos
Message 2 of 4
(3,571 Views)
Hi,
Thanks for the replay,
Where can I find the directory cintools (I ran a search and found nothing).
 
I've another problem, When I'm not using DSNewHandle and I run my program I get a popup message - see attach file for the error message
0 Kudos
Message 3 of 4
(3,562 Views)
Hi,

If you have LabVIEW installed, the cintools directory will be under the LabVIEW directory.  For example, C:\Program Files\National Instruments\LabVIEW 7.1\cintools.

Also, here is a link to a knowledgebase that gives information about the error that you are receiving.
0 Kudos
Message 4 of 4
(3,537 Views)