Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Creating a CVI DLL That Contains an UIR File, And Use The DLL in Visual C++

8 ratings | 2.12 out of 5
Print

Downloads

Filename: vc__.zip
Requirements: View

Filename: cvi.zip
Requirements: View

There are two .zip files in this example program. CVI.zip contains the workspace (testCVI.cws) and files necessary to create the DLL in CVI. This DLL exposes a function that loads a CVI panel. VC++.zip contains the workspace (testDLL.dsw) and files necessary to create a MFC project that calls the CVI DLL created in testCVI.prj. When you run the program in the VC++.zip file, you'll see an "Open Panel" button. When you click the "Open Panel" button, it loads and displays the CVI panel through the CVI DLL called testCVI.dll. Click the "Quit" button on the CVI panel and then click the "Cancel" button on the MFC dialog in order to close the program.

In CVI projects, note that the cvi\include and cvi\sdk\include directories are explicitly specified in the include path. To check these directories, go to Options»Include Paths in the project window. Also, note that in the testCVI.c file you need to call LoadPanelEx function, not LoadPanel function. LoadPanelEx is similar to LoadPanel, except that the callback functions you reference in your .uir file can be defined in the DLL that contains the call to LoadPanelEx. LoadPanelEx function has an additional parameter, callingModuleHandle, where you can use the default parameter, __CVIUserHInst, to specify the handle of the module that contains the call to LoadPanelEx.

In Visual C++ projects, note that you need the .lib, .dll, .h, and .uir files for the DLL you created in CVI. Note that you do not need to include .obj for the callback table in your Visual C++ project.

Requirements


Filename: vc__.zip

Software Requirements


Application Software: LabWindows/CVI Full Development System 6.0
Language(s): C++, C
Additional Software: Visual C++ 6.0

 
Filename: cvi.zip

Software Requirements


Language(s): C, C++

 
8 ratings | 2.12 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).