09-20-2012 11:12 AM
Hi!
How do we create registry key in LabWindow? Do they have different than Windows 32 functions?
09-20-2012 11:44 AM
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'
09-20-2012 11:56 AM
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.
09-27-2012 09:15 AM
Hello NI,
is there any comment on the above mentioned issue of Ini_WriteToRegistry (inifile) vs. RegWriteString (toolbox)?
Thanks!
09-27-2012 10:30 AM - edited 09-27-2012 10:39 AM
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.
09-27-2012 10:41 AM - edited 09-27-2012 10:42 AM
Thanks Roberto!
10-04-2012 12:53 AM
Hello NI,
is there any comment on the above mentioned issue of Ini_WriteToRegistry (inifile) vs. RegWriteString (toolbox)?
Thanks!
10-04-2012 10:40 AM
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
10-04-2012 12:39 PM
Thank you, Darren, for answering my question.
This leaves Roberto's question if these functions are limited to 32 bit...
10-05-2012 02:10 PM
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.