LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add a title bar to a sub panel and make it movable?

If a crash is happening, it is probably happening for a reason and I'd suggest trying to figure out why and fixing it.  That being said the simple solution (because you are just exiting) might be to just task kill the application, once you are sure all hardware and file references are closed.  Of course having a crash might indicate that you aren't actually closing all references so that might be something to look into.

 

I think this link describes a way of taskkilling:

 

https://decibel.ni.com/content/docs/DOC-28012

 

and here is a discussion on LAVA about why you probably shouldn't need this:

 

https://lavag.org/topic/16737-application-task-kill-on-exit/

0 Kudos
Message 11 of 18
(2,100 Views)

It's a reference specific to the setparent function in user32.dll. FP.nativewindow is being used to grab the WND handles which are integers in labview. Do they need to be closed inside user32.dll? If so, how do I do so since they are integers in labview?

0 Kudos
Message 12 of 18
(2,092 Views)

In all the custom Windows functions I've used that deal with the pointer HWND I've never had to do anything with closing it in LabVIEW.  I assumed it was just a number referencing a place in memory, and that number would point to a non valid HWND when the window went away.  I suspect your problem isn't with not closing the HWND reference.  You can write a simplified VI that uses this and I suspect you wont have a crash error on exit.

0 Kudos
Message 13 of 18
(2,081 Views)

If you do a FindWindow() call the returned HWND is not refcounted at all but simply returns the handle. Same about reading the FP.NativeWindow property. Therefore you should not attempt to close that HWND yourself but it will rather be closed by whoever created the window in the first place.

 

However you will notice that the FP.NAtiveWindow property is an uInt64 value. That should not let you fall into the trap of defining the HWNDs to SetParent() function as an unsigned 64 bit integer. On LabVIEW for 32 Bit that certainly will mess up your stack. But defining it as 32 bit integer is equally wrong if you ever intend to run the VI in LabVIEW 64 bit. The correct configuration here is a pointer sized integer which will take care to adapt to the bitness of the current LabVIEW version.

 

Now another thing you should be careful is that if you have set the parent of a Window you should also take care of unparenting the child window before you destroy the parent. This happens by calling SetParent() again with a NULL HWND for the hParent value. Otherwise Windows will attempt to pass events up to the now inexistent parent window and that can explain some of your crashes.

 

And last but not least you may have to do some extra work when parenting and unparenting a child window. The documentation to SetParent() on MSDN states specifically that you should also adjust the WS_CHILD and WS_POPUP windows style flags when parenting and unparenting a window, since Windows doesn't to that itself automatically for compatibility reasons, but these flags do have an effect in how windows events are handled for parented child windows.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 14 of 18
(2,076 Views)

Should it be a signed or unsigned pointer sized integer?

0 Kudos
Message 15 of 18
(2,062 Views)

Use whatever signedness is returned by FP.NativeWindow. It shouldn't really matter in practical use but avoids a coercion dot, which is always nice to do.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 16 of 18
(2,056 Views)

On the labview side, do I use 0 for null?

0 Kudos
Message 17 of 18
(2,052 Views)

Didn't fix the problem. Does this mean anything?

 

####
#Date: Tue, Oct 27, 2015 12:34:19 PM
#OSName: Windows 7 Enterprise Service Pack 1
#OSVers: 6.1
#OSBuild: 7601
#AppName:
#Version: 14.0 32-bit
#AppKind: AppLib
#AppModDate: 0/27/2015 16:32 GMT
#LabVIEW Base Address: 0x30000000
 
 
InitExecSystem() call to GetCurrProcessNumProcessors() reports: 8 processors
InitExecSystem() call to GetNumProcessors()           reports: 8 processors
InitExecSystem()                                     will use: 8 processors
starting LabVIEW Execution System 2 Thread 0 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 1 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 2 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 3 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 4 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 5 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 6 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 2 Thread 7 , capacity: 24 at [3528808460.77837470, (12:34:20.778374672 2015:10:27)]
starting LabVIEW Execution System 4 Thread 0 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 1 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 2 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 3 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 4 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 5 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 6 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
starting LabVIEW Execution System 4 Thread 7 , capacity: 24 at [3528808460.80037590, (12:34:20.800375939 2015:10:27)]
 
<DEBUG_OUTPUT>
35:21.4
Crash 0x00000000: Crash caught by NIER
File Unknown(0) : Crash 0x00000000: Crash caught by NIER
minidump id: 31a12764-f49f-4cac-88ec-af578c5a6c9a
ExceptionCode: 0xC0000005
 
</DEBUG_OUTPUT>
0x100011AB - nierInterface <unknown> + 0
0x10005E86 - nierInterface <unknown> + 0
0x1000620C - nierInterface <unknown> + 0
0x0ED6E6B7 - cei_install <unknown> + 0
0x77A47782 - ntdll <unknown> + 0
0x77A334BB - ntdll <unknown> + 0
0x00000000 - <unknown> <unknown> + 0
0 Kudos
Message 18 of 18
(2,044 Views)