LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Registry key from LabWindows

Hi!

 

How do we create registry key in LabWindow?  Do they have different than Windows 32 functions?

0 Kudos
Message 1 of 10
(4,614 Views)

You may want to have a look at the inifile.fp instrument driver; it provides the possibility to read/write tag/value pairs to the registry.

 

A side note to NI: The function panel for Ini_WriteToRegistry claims that this function is available only on Windows 9x/NT/2000 - this is odd because these OS are not supported by CVI2012 anymore which still provides this function... Also, the F1 help on Ini_WriteToRegistry does not mention this limitation; in addition, compiling source code with this function on XP does not generate an error. Hence I tend to assume that this warning is a bit 'misleading' Smiley Wink

0 Kudos
Message 2 of 10
(4,613 Views)

There are also registry functions in the Programmer's Toolbox (i.e. RegWriteString(..) and others).  My guess is that NI intends for us to use these functions now instead of the ones in the Ini File instrument.

0 Kudos
Message 3 of 10
(4,609 Views)

Hello NI,

 

is there any comment on the above mentioned issue of Ini_WriteToRegistry (inifile) vs. RegWriteString (toolbox)?

 

Thanks!

0 Kudos
Message 4 of 10
(4,565 Views)

I really see no great difference between those possibilities: both instruments rely on the very same Windows API to access the registry, so if your information is structured as an Ini object you'll use Ini_WriteToRegistry (); you'll use Reg_WriteXxx function otherwise.

 

 

Regarding the note from Wolfgang, some clarifications from NI would be helpful: I see no note on Toolbox function panels, those from iniFile instrument claim these functions are only available up to Win2k, while source code for them states "This function is only available on Win32 platforms", which is quite different. SDK functions used are available even on 64bit OSes (even though there are some caveats on accessing the registry on 64bit machines due to key virtualization and redirection) and the only difference I see in the code is toolbox function preparing 'keySecurity' parameter while IniFile functions don't.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 10
(4,560 Views)

Thanks Roberto!

0 Kudos
Message 6 of 10
(4,554 Views)

Hello NI,

 

is there any comment on the above mentioned issue of Ini_WriteToRegistry (inifile) vs. RegWriteString (toolbox)?

 

Thanks!


 

0 Kudos
Message 7 of 10
(4,505 Views)

Hi All,

 

Sorry it took so long to respond. There was no apparent reason why these functions were limited to Windows 2000 and earlier, but to be sure I had to track down someone who worked on these functions a long time ago.

 

As you have found, these functions work fine on Windows XP and later. It seems that this warning was just never updated. Surprisingly, I think the warning was originally meant to limit functionality to Windows 9x and later. Because the warning only exists in the .fp instead of an .fpx and not in the help as well, it missed our usual searches.

 

Bug ID: 373262

National Instruments
0 Kudos
Message 8 of 10
(4,491 Views)

Thank you, Darren, for answering my question. Smiley Happy

 

This leaves Roberto's question if these functions are limited to 32 bit...Smiley Wink

0 Kudos
Message 9 of 10
(4,482 Views)

I missed that question, thanks for pointing it out.

 

No, these functions have not been updated for use with 64-bit Windows. You will get missing prototype error when compiling if you try to use it. Of course, we do provide the source code for this library and the other libraries in toolslib, so you are welcome to update this yourself if you need to use them for 64-bit. However, the functions in Programmer's Toolbox are updated for 64-bit.

National Instruments
0 Kudos
Message 10 of 10
(4,463 Views)