LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I embed a running LabVIEW child window within C?

I need to write my application using Borland C++ but I want to use LabVIEW toolkits for analysis. I have been doing some initial investigations into how I can link the LabVIEW into my C++ code. I have been successful in being able to create a LabVIEW dll and then call that from my C++ code and set the LabVIEW window as a child of my C++ window by calling the 'FindWindowA' function of the Windows API from within LabVIEW to supply my C++ code with a handle to the window.
 
I thought I'd done the tricky part until I then tried to make my LabVIEW test VI a little more realistic - so instead of just suppling the handle to itself, I wanted it to sit in a loop taking commands until I was finished with it. This is where I am running in to problems. If I have just the one VI with the 'doing something' loop in it as well as passing the handle, my C++ code waits until the VI is closed before passing the handle. I've tried splitting my LabVIEW code into the 'do something' VI, with the window I want to embed in C++, and a second VI which loads the 'do something' VI and which also returns the handle. When I run this in LabVIEW it acts I as I'd intended but when calling from C++ no window appears.
 
So, to try and clarify, from C++ I want to get a handle to a LabVIEW VI with a front panel that I will eventually display graphs and which the user will need to make selections and press buttons on. I want to use that handle to set the LabVIEW window as a child of my C++ window, and then I want that VI to keep running until the user selects to close it.
 
I've attached the LabVIEW code - I don't think the C++ code will be of much use here but I can give details if necessary.
 
Thanks in advance for any help.
CAS
0 Kudos
Message 1 of 4
(3,197 Views)
Hello,
 
Can you try zipping that code up again as when I try to open either of the VIs they close LabVIEW immediately. Do you experience the same behaviour on your development machine?
 
Tom
NIUK
0 Kudos
Message 2 of 4
(3,169 Views)

Dear Tom

Thanks for the reply - apologies for my delay but I have been out of the office. I have just downloaded that zipped code from the website and it's okay on my PC. Could it be a version clash? Currently I am running the LabVIEW 8.2 Evaluation package and the VIs were created using that.

Anyway, I'll re-attach a fresh zip file to see if that's any better.

Cheryl

0 Kudos
Message 3 of 4
(3,145 Views)

To anyone with a similar problem:

After not resolving my problem in this thread, a posted a new question which contains the solution. The title of the thread is:

'Get a handle from a LabVIEW dll for C++ before the vi closes'

Cheryl

0 Kudos
Message 4 of 4
(3,087 Views)