Error "H must be the handle to a figure or figure descendent" on deployed code but not on host machine.
1 次查看(过去 30 天)
显示 更早的评论
Hello!
I have a gui program that works on my machine (64 bit) and compiled for a client's machine (also 64 bit). The client also has a 32 bit machine, and I used MATLAB 32 bit to compile the code.
The program goes without a hitch on my machine as well as the client's 64 bit machine, but on the 32 bit machine it goes along just fine until at one point it hangs up. When the client exits (through a close and exit), the error message appears, with line 42. In the gui, that's part of the initialization code, which I didn't edit.
It hangs up when doing some rather intense calculations.
So:
- Is the error really not at line 42? And where is it then?
- Can I find out what is going on, on the client's machine?
- Why would it work on these other machines and not on the 32 bit one?
Thanks
Doug
For refresher:
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @tvm3out4_OpeningFcn, ...
'gui_OutputFcn', @tvm3out4_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:}); %%%%%%THIS IS LINE 42
end
% End initialization code - DO NOT EDIT
2 个评论
Geoff Hayes
2014-10-16
Doug - line 42 is probably correct; it is just given as the "starting" point of where the GUI begins its execution. For example, suppose I launch a GUI and put a breakpoint in the callback of a toggle button. I then press that button, and the debugger pauses at the line with the breakpoint. Then in the Command Window, I type
dbstack
I observe
In MyApp>uitoggletoolPlay_ClickedCallback at 96
In gui_mainfcn at 95
In MyApp at 42
In @(hObject,eventdata)MyApp('uitoggletoolPlay_ClickedCallback',
hObject,eventdata,guidata(hObject))
which is the line numbers and file names of the function calls that led to the current breakpoint, listed in the order in which they were executed. Unfortunately, that doesn't help you at all in terms of determining what is causing the crash.
You say that the app crashes when the client exits (through a code and exit) of the GUI. Do you have code that captures this event? i.e. something in the CloseRequestFcn or DeleteFcn functions of your GUI? You mentioned that the GUI is doing some intense calculations at this point. What does that mean - do you have some timers going, FFTs, etc.? If you have some timers, then do you stop them gracefully during the close or just ignore them?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!