06-29-2007 08:12 AM
06-29-2007 09:53 AM
Some additional information...When debugging the executable through Labwindows 7.1.1, I call GetCVIVersion() and it returns 811 suggesting it is getting its runtime engine from the system32 directory. Is this true?If I put the 7.1.1 runtime engine in the same folder as the debug executable and then run the debug through Labwindows, GetCVIVersion() now returns 711.
Two Questions:
1) When I am running Labwindows environment, what runtime engine is used and where does it get it?
2) Do I need to always put the correct run-time engine files in my project directory, so that when I debug using labwindows I can be sure I know the run-time engine version? This will also allow me to control which run-time engine is loaded during debugging so I can match the run-time engine in the distribution kit.
-Ryan
06-29-2007 11:53 AM
Windows NT/ 2000: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.
[This is preliminary documentation and subject to change.]
Problems can occur when an application loads a version of a DLL other than the one with which it shipped. Starting with Windows 2000, you can ensure that your application uses the correct version of a DLL by creating a redirection file. The contents of a redirection file are ignored, but its presence forces all DLLs in the application's directory to be loaded from that directory.
The redirection file must be named as follows:
appname.local
For example, if the application's name is editor.exe, the redirection file is named editor.exe.local. You must install editor.exe.local in the same directory that contains editor.exe. You must also install the DLLs in the same directory.
The LoadLibrary and LoadLibraryEx functions change their search sequence if a redirection file is present. If a path is specified and there is a redirection file for the application, these functions search for the DLL in the application's directory. If the DLL exists in the application's directory, these functions ignore the specified path and load the DLL from the application's directory. If the module is not in the application's directory, these functions load the DLL from the specified directory.
For example, an application c:\myapp\myapp.exe calls
LoadLibrary using the following path:
c:\program files\common files\system\mydll.dll.
If c:\myapp\myapp.exe.local and c:\myapp\mydll.dll
exist, LoadLibrary will load c:\myapp\mydll.dll. Otherwise,
LoadLibraryc:\program files\common files\system\mydll.dll. will load
Note It is good practice to install your application's DLLs in the same directory that contains the application, even if you are not using redirection. It ensures that installing your application will not overwrite other copies of the DLL and cause other applications to fail. In addition, other applications will not overwrite your copy of the DLL and cause your application to fail.
06-29-2007 12:06 PM
Thanks for the reply. I started to try and remove my 8.1 runtime by going to the Add or Remove.... in the control panel but when I started to uninstall it won't let me uninstall the run-time without also uninstalling Labwindows/CVI. I manually went into the system32 and deleted the 8.1 runtime files and replaced them with the 7.1.1 runtime files but the system still thinks there is 8.1 runtime on my computer. I then went and repaired the installation of the 8.1 runtime files to hopefully avoid any confusion for myself sometime down the road.
So....I will now always include the run-time engine files in my project directory to ensure that I am using the same version on both my development system and in the distribution kit.
Thanks,
Ryan
06-29-2007 12:16 PM - edited 06-29-2007 12:16 PM
Message Edited by menchar on 06-29-2007 10:17 AM
Message Edited by menchar on 06-29-2007 10:18 AM
06-29-2007 12:21 PM
So even though GetCVIVersion() returns 711 (which is the runtime version in my application directory), it may actually be running 8.1 runtime engine?
-Ryan
06-29-2007 12:28 PM
06-29-2007 12:32 PM
I'll try to test this and let you know what I find. We have been burned by the run-time engines getting out-of-sync before so controlling them is important for us. I will try the .local trick as well.
-Ryan
06-29-2007 12:58 PM - edited 06-29-2007 12:58 PM
Message Edited by menchar on 06-29-2007 11:01 AM
06-29-2007 01:07 PM
We ran into some issues when we migrated from Labwindows v6 to 7.1. We now always use distribution kits AND put the run-time engine in the application directory. The redirection method is a nice idea so I will look into using it. Hopefully someone from NI will chime in and give insight on this. It is very easy for some other installer to get in and install a new run-time engine into the system32 directory without us knowing it. I don't like this but hopefully we can learn to live with it and not rely on the system32 directory for files.
Thanks,
Ryan