LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

menu proble

Hi guys and gals
 
 My problem is I would like to add selected files paths in file menu dynamically..please slove  my problem with an example
 
if you see the word when u open a file and close the word..when u again open the word u will see the recent files...my problem is
 
exactly the same...waiting for yr replies
 
it's urgent I hope some one will slove my problem...
 
0 Kudos
Message 1 of 6
(3,564 Views)
The \samples\toolbox\menudemo.prj is exactly what you need: a dynamical list of last opened files in the "File" menu.
 
The MRU list of files is actually stored in the registry (on some machines can be stored in an INI file: see the MU_WriteRegistryInfo functions for details).


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 2 of 6
(3,550 Views)
how can i find out the introduction of MU_WriteRegistryInfo functions? why is it not be included in  NI LabWindow/CVI Help?
0 Kudos
Message 3 of 6
(3,492 Views)

A short documentation is included in the instrument driver as online help on the function panels, some informations more are coded directly in the source file menuutil.c. As you can find following the source code, the instrument driver ultimately writes / read from the registry using RegXxxxxx functions from the SDK, where you can find the documentation for these functions. Keep in mind that part of these functions has been implemented into the Programmer's toolbox instrument (Windows registry section) that you can load into your projects.

Which other information are you looking for?



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 4 of 6
(3,488 Views)
MU_PutFileListInIniFile
MU_GetFileListFromIniFile
MU_DeleteMenuList
MU_CreateMenuList
MU_WriteRegistryInfo
MU_ReadRegistryInfo
i need the detail information of the function above , the info of how to use it  and the parameter setting.
 
the function help in the function panal is so simple. it doesnot include the parameter information
 
thanks a lot
0 Kudos
Message 5 of 6
(3,464 Views)

The menudemo project relies really on 2 different instrument drivers: menuutil.fp and inifile.fp, the second one located in toolslib\toolbox directory.

MU_WriteRegistryInfo and MU_ReadRegistryInfo rely on the inifile instrument to read / write informations from the registry. The instrument uses a IniText variable (here treated as a global) as a general handle for a tag/value memory structure useful for storing informations in a categorized fashion. To simply use these functions you only need to define the initext variable and the key on the registry to read/write. Understanding internal behaviour of the functions implies understanding the inifile instrument driver, which is not so simple, but is not really necessary to use them.
The MRU list is recorded in HKEY_CURRENT_USER\Software\National Instruments\CVI Sample\MenuDemo registry key, in which a "FILE MenuList" subkey is created to hold filenames with keys "FilenameX" that store the pathname of the files. These addresses are hardcoded in menuutil.c source and can be tailored to suit your preferred location in the registry.
"FILE MenuList" is a parameter in MU_GetFileListFromIniFile, the same as "Filename" prefix.
 
The other functions of the sample are internal to the menuutil instrument, and use menulist variables (again set as global), one for each menu to populate and maintain.
 
Basic structure of the project is, after you have read from the registry the MRU list and placed in memory (in the area pointed to by initext variable) you work on the menus populating them, next you start your program [  RunUserInterface ();  ]. From this moment on, every file-related operation involves maintaining the MRU list on the file and window menus.
 
At program end, you read from the menus the MRU list and save to the registry.
 
I hope this helps you in approaching this instrument.
Roberto


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 6 of 6
(3,458 Views)