LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Project link error

Dear NI,
I tried to insert a function which is called RegQueryValue(HKEY hkey, LPCTSTR lpSubKey, LPTSTR lpValue, PLONG lpcbValue) but in the end when I want to built it, it come out a message stated "Undefined symbol '_RegQueryValueA@16' referenced in "CDRW.C"". In addition, I do include winreg.h in the CDRW.c file. Is there anything I haven't do so that it come out such message? Hope to hear from you all soon. Thanks.
0 Kudos
Message 1 of 6
(3,666 Views)
You need to include the Windows SDK library 'Advapi32.lib' in your project.

Note that according to Microsoft RegQueryValue() is obsolete now, you ought to be using RegQueryValueEx() instead.

Martin.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 6
(3,654 Views)
Did you add Advapi32.lib to your project?
Include windows.h and winreg.h

The Programmer's Toolbox (included in CVI) includes some registry functions that may be easier to use.
Add ...\CVI\toolslib\toolbox\toolbox.fp to your project.
#include "toolbox.h" in your .c file.
Look at the Windows Registry functions in the Programmer's Toolbox Instrument.
Look and the sample project ...\CVI\samples\apps\regadd\RegAdd.prj
Message 3 of 6
(3,653 Views)
Dear all,
Thanks for your reply. In fact, I am just a begginer as a CVI user. May I know how to include 'Advapi32.lib' in my project? Thanks.
0 Kudos
Message 4 of 6
(3,636 Views)
In the menu of the project window go: edit >> add files to project >> library (*.lib)
Advapi32.lib is found in cvi\sdk\lib
-----------------------
/* Nothing past this point should fail if the code is working as intended */
Message 5 of 6
(3,630 Views)
Dear all,
Thanks for replying. Problem solved.
0 Kudos
Message 6 of 6
(3,602 Views)