Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How I can run DLL generate from Labview in my MFC project?

Hi,

   Now, I need to use a dll ,which generated from labview,  to my MFC project. It seems like this, when I click a button on my MFC , pop the  application front panel (as see in the labveiw) . Anyone knows how can achieve it?

0 Kudos
Message 1 of 2
(2,712 Views)

Hi Tinafan,

 

In order to launch a VI front panel when calling a LabVIEW-built DLL, please refer to the following resources. The first discusses how to configure a VI to launch the front panel when DLL functions are called and the second provides an example of doing so. 

 

How Can I Call My DLL And Have Its Front Panel Open?

http://digital.ni.com/public.nsf/allkb/D363FE185910D952862569F40078FF8C

 

You may want to play with the modal option for the UI as well unless you want your c++ application to continue executing while the front panel is active.

 

Displaying the Front Panel of the LabVIEW-Built DLL Function

http://www.ni.com/example/26887/en/

 

Once you configure the VI, build the DLL and add the header file to the "Header Files" location. Then, follow the link below to add the .lib file in the Additional Dependencies field of the Linker >> Input tab of the project properties:

 

.Lib Files as Linker Input

https://msdn.microsoft.com/en-us/library/ba1z7822.aspx

 

You will also likely need to edit the path in your LabVIEW header to extcode.h to include the full path. The correct path for the 32-bit version is "C:\Program Files (x86)\National Instruments\LabVIEW 2016\cintools\extcode.h". You may also need to copy the .dll file into the project directory so that the application can find it. 

 

Once everything is configured, add a #include directive at the top of the source file you want to launch the VI front panel from. This will also likely need to have the full path to the file. You should then be able to call functions from the DLL, which will subsequently launch the VI front panel.

 

If you want to embed the VI front panel in a window generated from the c++ project, the following forum thread addresses how you can do so:

 

display and interact with a vi front panel on remote C++ app

http://forums.ni.com/t5/LabVIEW/display-and-interact-with-a-vi-front-panel-on-remote-C-app/td-p/5123...

Regards,
Message 2 of 2
(2,559 Views)