|
本帖最后由 luoxianli 于 2009-2-26 10:14 编辑
近来碰到在LabWindows中使用.NET 控件写的DLL,最开始不知道怎末用,没有.h文件, 而且DLL函数查看器无法查看函数,也就是说.NET 控件写的DLL不是我们一般通用的DLL。反复摸索终于找到解决办法,请参照下面两步:
1. .NET Framework Error Message When Using the .NET Controller Wizard in LabWindows/CVI
Primary Software: LabWindows/CVI Development Systems>>Base Package
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: LabWindows/CVI Development Systems>>Base Package
Problem:
When I select Tools » Create .NET Controller, I receive the following error message: "Could not load required CVI .NET modules. Install .NET Framework version 1.1 or higher
and repair the CVI and CVI Runtime Engine installers to install the CVI .NET modules."
Why am I receiving this error and what I can do to fix it?
Solution:
When you install LabWindows/CVI, we check the registry to determine if the .NET Framework 1.1 or higher is installed. If so, we install .NET support onto the system.
The message above is simply stating that LabWindows/CVI .NET components are not installed. Typically you run into this scenario if you installed the .NET Framework after you installed LabWindows/CVI.
To install LabWindows/CVI .NET support, reinstall LabWindows/CVI or repair the existing LabWIndows/CVI installation.
After repairing or reinstalling, the error message should disappear.
2. Create LabWindows/CVI .NET Controller Dialog BoxUse the Create LabWindows/CVI .NET Controller dialog box to generate a LabWindows/CVI wrapper for a .NET assembly. LabWindows/CVI generates the wrapper in the form of an instrument driver, source file, and header file. You also can use the LabWindows/CVI .NET Library functions in conjunction with the generated wrapper when calling a .NET assembly.
Note LabWindows/CVI supports .NET framework version 1.1 or later. To create a LabWindows/CVI wrapper for a .NET assembly or to use the .NET Library, you must have .NET 1.1 or later installed on your computer. You can download the .NET framework from the Microsoft Web site.
If you install the .NET framework after you install LabWindows/CVI, you must then reinstall LabWindows/CVI or repair the existing LabWindows/CVI installation.
Select Tools»Create .NET Controller to open the Create LabWindows/CVI .NET Controller dialog box. The Create LabWindows/CVI .NET Controller dialog box provides the following controls:
- Assemblies in Global Assembly Cache—Lists the .NET assemblies that are available in the Global Assembly Cache (GAC) on your computer. If you enable the Specify Assembly by Path option, this control is not available. The Assemblies in Global Assembly Cache list provides the following information:
- Name—The assembly name.
- Version—The version number of the assembly. This number consists of major and minor version numbers.
- Culture—The language or region the assembly targets. The culture can affect strings, time, currency formats, and so on. Neutral indicates that the assembly does not target a specific language or region.
- Public Key Token—The key, provided by the assembly creator, that is used for security and cryptographic purposes.
Note If two or more assemblies differ by name, version, culture, or public key token, .NET considers them to be different assemblies. | |
- Specify Assembly by Path—Specifies whether to generate the wrapper for the .NET assembly in the Assembly Path control. If you enable this option, the Assemblies in Global Assembly Cache control is not available.
- Assembly Path—Specifies the path and filename of the .NET assembly for which LabWindows/CVI generates a wrapper. You can use the Browse button to browse to the .NET assembly.
- Target Instrument—Specifies the path and filename of the instrument driver LabWindows/CVI generates. You can use the Browse button to browse to a new or existing .fp file.
- Add Instrument to Project—Specifies whether to add the generated .fp file to the current project.
Note LabWindows/CVI returns an error if you attempt to run multiple instances of the Create LabWindows/CVI .NET Controller dialog box at the same time. | |
When you click OK, LabWindows/CVI opens a renaming dialog box, which you can use to modify the names of .NET identifiers in the target assembly.
After LabWindows/CVI generates the wrapper, it opens a dialog box that indicates it has successfully generated an instrument driver to control the selected .NET assembly. If the selected assembly references types that are defined in other assemblies, the dialog box displays a list of the names and locations of the assemblies in which these types are defined. You must generate wrappers for the assemblies if you need full access to the types defined in them. If the wrapper generation process returned errors and/or warnings, the dialog box displays a Warnings and Errors section. |
评分
-
查看全部评分
|