- The 'dllPath' and 'headerFile' should be correctly defined in the code in order to use them correctly.
- This assumes that 'app.statusText' is a valid UI property. If 'app.statusText' does not exist or is not correct type of UI control this line will throw an error.
- Lastly try changing the line 'app.statusText.Text = errorMessage;' to app.statusText.Text = ex.message' and then try to run the code.
Errors during accessing .dll files using MATLAB
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello all,
Currently i am planning to run a .dll file from an SDK using my MATLAB App vreated in App Designer, and I am facing a few errors with the same. (error shown below)
I would greatly appreciate if anyone can help me with these issues.
Best,
Sushant
Error loading DLL: Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in App_Sushant_2/startupFcn (line 124)
app.statusText.Text = errorMessage;
The code refreed to in the error message shows assigning a public property as app.dllHandle and has it code as follows:
- methods (Access = public)
% Construct app
function app = App_Sushant_2
app.dllHandle = [];
- try
% Load the DLL and store the handle in dllHandle property
app.dllHandle = loadlibrary(dllPath, headerFile); %'alias', 'Neurostimulator_HID_DLL_2'
app.statusText.Text = 'DLL loaded successfully';
catch ex
% Display error message if DLL loading fails
errorMessage = sprintf('Error loading DLL: %s', ex.message);
disp(errorMessage);
app.statusText.Text = errorMessage;
return;
end
댓글 수: 0
채택된 답변
Ayush Singh
2024년 2월 12일
Hi Sushant
In order to get rid of the error you may try the following :
I hope the above information helps!
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!