LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Load LabVIEW front panel in MFC application

I tried the source codes in the example "Integrating LabVIEW Code into Other Programming Languages". It works fine. I tried to make it in a MFC dialog-based or SDI application. It failed. The front panel didn't pop up. In debug mode of my MFC application, I also found that the outputs from the dll functions are wrong (compared to the original sample). Please help. Thanks.
0 Kudos
Message 1 of 7
(3,376 Views)
Hello,

Could you be more specific about what how you got it working at first and what is not working in a MFC dialog-based or SDI application?

- In what environment did you get it working?
- When you say it worked, do you mean it functioned correctly, or where you able to follow all of the steps in the tutorial (including opening the front panel)?
- When you say the dll functions are wrong, is that implying that the parameters did not show up correctly for the functions or that the functions could not be found at all within the dll?

The more specific information you can give us, the better. Thank you for writing in. Take care!

Aaron Beitner
National Instruments
0 Kudos
Message 2 of 7
(3,376 Views)
Hi,

I tried the example in
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B59021C6BEFA1892E034080020E74861&p_node=DZ52048_US&p_source=external

Just compiled and executed it. A dos prompt appeared and then the front panel in the labview generated dll appeared.

I tried to use VC6 to build an application which has a button and when I press it, the labview front panel pop up. I copied all the codes in the tutorial's main() to my OnButton() function and also all those #include and #define statements. I compiled it and got a warning saying that I should include "\nodefaultlib: libc" in my link option. After I included that, no warning in compilation. When I execute my program and press that button, the labview front panel didn't appe
ar.

Then, I tried to run the tutorial program and my MFC program separately in VC debug mode. I set breakpoints in the lines which call labview dll exported functions. I compared their input and output of each labview dll exported function. I found that their inputs are the same while outputs are different.

Thanks in advance.
0 Kudos
Message 3 of 7
(3,376 Views)
Hi Herman,

I have run the sample code myself and then made the modifications, following the steps you described, to incorporate the code (by copy and pasting) into another project that uses a button to call up the front panel of the dll in LabVIEW. Everything seemed to work fine for me. I will attach a zip file with all of the code that I used.

When I first tried to run the example code, I could run it, but was not able to pop up the front panel (or call the dll at all). This sounds like it may be a similar problem to the one that you are now encountering. I was able to resolve things by rebuilding the dll in LabVIEW. After I did that, everything was running fine. Other than that, it is hard to say what the problem could be.
Feel free to use the code that I have sent you in. I hope that it helps. Good luck and take care!

Aaron Beitner
National Instruments
0 Kudos
Message 4 of 7
(3,376 Views)
I can run your program. What is your setup for this in application builder? Can you attach your .bld file here?
Another question: Is it possible to embed the LabVIEW dialog into one of the window of a MFC MDI application? Thanks a lot.
0 Kudos
Message 5 of 7
(3,376 Views)
Hi Herman,

There should be a BLD file in the zip that I sent you. It is called, AAPLV.bld. For your convenience, I am also attaching a copy of it with this discussion forum post.

To answer your other question about embedding LabVIEW, the answer is no, you cannot. It is impossible to embed LabVIEW in the panel of another application. LabVIEW acts as an ActiveX server, but does not allow the creation of ActiveX controls (which are what you embed in other applications). Thus LabVIEW always has to be called up in a separate window.

I hope that I have answered your questions and that your application runs smoothly. Take care and have a great day!

Aaron B.
National Instruments
0 Kudos
Message 6 of 7
(3,376 Views)
Thanks. I found it.
Is it possible to control the position and size of the popup LabVIEW panel/dialog in a MFC application?
0 Kudos
Message 7 of 7
(3,376 Views)