LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Window created by DLL does not close

Hello all,

I'm a labview newbie and I'm having a scuffle with a program I'm trying to write.  I'm calling a DLL file that creates a window, however, when the VI's execution ends, the window is still up.  The window remains up until I close all labview windows.  Every time I run my program within labview another window pops up.  This window that pops up does not respond to one clicking the "x" in the top-right hand corner.  I tried using windows API calls to close the window, but that does not work either.

Any Ideas?
0 Kudos
Message 1 of 8
(2,801 Views)
You didn't provide information about the dll.  It's hard to guess.
 
Whomever create the dll should provide a proper way to close the window.
 
The window is created within the LabVIEW process, so when you close all LabVIEW windows, the process terminated, so does the window.
 
If the close window button ("x") isn't disable, and not responding, the window might hang or it's just bussy.  You should contact whomever
created this dll for a solution.
 
George Zou
George Zou
0 Kudos
Message 2 of 8
(2,783 Views)
try putting this at the end of your execution flow of the LV code.  If you could let us know a little more about your app.  I am guessing here with my solution but it might work.  Hope it helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 3 of 8
(2,774 Views)
Whoops, sorry about the lack of info in the first post.  The DLL is a work-in-progress here to get some functions of the VTK toolkit into LabView.  Basically it creates a window with an OpenGl rendering area inside.  I tried calling DestroyWindow on the window but that does not work.

I'm unsure what the picture (closewindow.jpg) you have posted means.  This is not a VI creating the window, but rather a window being created like a normal windows application by a DLL.

Message Edited by pardasaniman on 09-07-2005 01:32 PM

0 Kudos
Message 4 of 8
(2,769 Views)
Quote SDK doc: "A thread cannot use DestroyWindow to destroy a window created by a different thread."
 
DestroyWindow only sends messages to the widnow you want close.  But if that widnow is bussy or hung, your message is not going to get processed.
Try call IsHungAppWindow.
 
 
George Zou
George Zou
0 Kudos
Message 5 of 8
(2,759 Views)
The window is definitely not hung because it still works.  I can play with the actors on the screen and it works fine except for the closing part.  How do I make sure that DestroyWindow is getting called from the original thread in Labview?  I have one control node to start it up and one to close it.
0 Kudos
Message 6 of 8
(2,753 Views)
Your dll might run in a different thread than LabVIEW.
In your dll, call GetCurrentThreadId.  You can terminate a thread with its id.
Make sure it's not LabVIEW GUI thread.
 
 
George Zou
George Zou
0 Kudos
Message 7 of 8
(2,745 Views)
Thanks guys for your help,

I think I found out the problem.  I think it's a logic error in my VI.  However, your advice will come in handy in debugging.  Sorry to have taken up your time!
0 Kudos
Message 8 of 8
(2,734 Views)