- 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
6 次查看(过去 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 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!