Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
cannot findobj() when running as an EXE application
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi Guys,
I have this weird issue where when im running my application from the Matlab env. everything is working well. when i later on compile it into an EXE and run it, it doesn't work. debugging showed me that the problem is when calling findobj();. when running in Matlab it returns the handle to the object im looking for and when running as an EXE it doesnt. For reference, see attached 2 images. one taken from within matlab and the second from the cmd prompt when EXE was running.
Console output running code from Matlab:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149223/image.jpeg)
console output running compiled code from windows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149225/image.png)
Code used:
% resetAllCheckBoxes(h);
checkBoxHandle = findobj('Tag',['param_',num2str(checkBoxNum)]);
disp('CHECK BOX HANDLE:')
checkBoxHandle
input('Press entere to continue');
set(checkBoxHandle,'Value',1);
end
Any idea whats going on here?
댓글 수: 0
답변 (1개)
Image Analyst
2015년 9월 19일
Add this code
str = ['param_',num2str(checkBoxNum)]
fprintf('checkBoxNum = %f\nLooking for tag = %s', checkBoxNum, str);
Any difference in what you see between the compiled and development environment?
댓글 수: 2
Image Analyst
2015년 9월 19일
You might want to investigate what ishandle() returns:
itsAValidHandle = ishandle(checkBoxHandle)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!