LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse moves causes crash

My application crashes when I move the mouse around over the parent window when a child is visible. The crash is somewhat intermittent, but only happens when I am moving the mouse over the underlying parent window.

My main window starts a seperate thread that is collecting highspeed data and plotting it on various controls in the application. The main window contains a stripchart of some of the data and the child window contains several stripcharts and graphs of data from the same data stream. The crash happens more often when I'm running a release version over the debug version (the release version runs faster and plots more often since the debug version cannot keep up with the incoming data stream).

The application will run fine if I don
't move the mouse or if I don't have the second plot window visible.

Any ideas?
Greg VanSlyke
0 Kudos
Message 1 of 6
(3,439 Views)
I've experienced something slightly diffirent but involving multy threading.

The only way to reslove problems like these is to establish where the occur. It's a tedious process, and especially when you get them in release versions only.

What you need to do is create a log file and put marker event(printf "I'm here" etc ) in you appllication in every function and first determine at what function block the failure occured and then add entries in the function block and determine what specific function call fails.

Then once you know more about your problem you will be closer to a solution and you migh be able to ask a more specific question.

Normlly works for me.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 6
(3,439 Views)
Perhaps I should clearify a bit.

This error does occur when running the debug build and I can break on the error. However, it doesn't always break at the same point in my code or in the same thread.

I don't do anything with mouse events (except clicks) and the application will not crash if I don't move the mouse. It also won't crash if I don't have the child window visible. All of the threads are always running even when the child window is not visible. I think the crash has something to do with lots of processing and plotting, multiple windows, and moving the mouse. And I don't think it's a problem with my code... but them's the famous last words of many a programmer.

I think the reason the application crashes more often in release mode is bec
ause it is running faster, getting data faster and plotting more often.
0 Kudos
Message 3 of 6
(3,439 Views)
I've solved (but still don't understand) the problem.

I started removing chunks of code until I narrowed it down to one line. When I update the plots in the child window, I use GetCtrlVal(panel_ls_handle,PANEL_LS_NUM_UPDATE,&dval)
to check the value of a numeric control (if 0 I update for every new data set, otherwise I wait for a timer flag).
If I comment out the GetCtrlVal line, I no longer get the error. PANEL_LS_NUM_UPDATE is a classic numeric control and I don't get or set it anywhere else in code. It only changes on user input, but I get the error regardless.

I'm stumped.
I put the line in, periodic crashes... take the line out... no crashes. I even removed everything else from the function and this GetCtrlVal still causes perio
dic crashes.

?? Greg
0 Kudos
Message 4 of 6
(3,439 Views)
Greg,

The problem could be in the CVI run-time engine itself, but we'd have to be able to reproduce it here in order to investigate it. If you were able to reproduce the problem in a small sample project, and you could attach it here, I'd love to look at it.

Luis
NI
0 Kudos
Message 5 of 6
(3,439 Views)
Hi,

Are you using the Extended Mouse Events? enabling extended mouse events uses the callback data for the control's callback. If you have extended events and use the callback data yoursef you could run into some crashes when moving the mouse.

Just my 2 cents.

Juan Carlos
N.I.
0 Kudos
Message 6 of 6
(3,439 Views)