LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when define my dll output in cvi6.0?

i am trying to experiment about dll output.pls see the attached! now i have two questions:
1)my cvi programme says a error .How to correct !
2)if i want to output the "addfunction" and "subtractfunction" to be dll type , how to continue? Thanks!
0 Kudos
Message 1 of 5
(3,284 Views)
Hello,

Your program is displaying an error when you try to set a control value to "numberresult" before any data is stored in "numberresult". I would suggest modifying your Addfunction to return an integer instead of "void" and assign that return value into "numberresult".

Regarding creating DLLs in CVI, I would suggest reading the tutorial titled FAQ: Using Dynamic Link Libraries with LabWindows/CVI


Scott Y
NI
0 Kudos
Message 2 of 5
(3,267 Views)
You have created an EXE project, not a DLL project. You need to pick one or the other.
From the Project window, go to Build >> Target Type >> Dynamic Link Library. You can use the Code Generator (Code >> Generate >> All Code) in the UI editor to create the shell of your program.
Create a .h file with prototypes for functions you wish to export. The functions may be declared similar to
extern long int DLLIMPORT MyDLLCdeclFunction(char * dummycharname);
From the Project window, go to Edit >> Add Files to Project... >> Include (*.h) to add your new .h file to your project.
Then go to Build >> Target Settings >> Change (in the Exports box). Select the .h file with the exported functions, then click OK.

Look at the sample programs that ship with CVI.
...\CVI\samples\dll\simple\cvi\readme.txt
...\CVI\samples\dll\simple\cvi\mydll.prj
...\CVI\samples\dll\simple\cvi\simple.prj
0 Kudos
Message 3 of 5
(3,261 Views)
could you give me a example of source code about it ?To generate the dll also ??thanks!
0 Kudos
Message 4 of 5
(3,258 Views)
Look at my earlier reply. It has some basic steps on creating a DLL and lists some of the DLL samples that ship with CVI. You should already have them on your disk. If you don't, just reinstall CVI and make sure the sample programs are selected.
0 Kudos
Message 5 of 5
(3,253 Views)