Encapsulating Matlab's Mouse Control Functions for C#
Hsu Yung-Cheng
on 22 Feb 2024
Latest activity Reply by Hsu Yung-Cheng
on 23 Feb 2024
When I embed Matlab windows into C#, I use C# to call the mouse functions such as drawline() and getpts() which are encapsulated in Matlab's dll, and then the program crashes, how can I solve this problem?
ps : The functions that I call in C# can be executed in Matlab.
ps : If I don't embed the window into C#, but just let C# call the Matlab function, it can execute the mouse control normally in the window, but once embedded into the C# window, it will crash when execute the mouse command.
2 Comments
Time DescendingI solved this problem by using an asynchronous thread (async). The reason it happens is that it gets stuck with the C# UI thread.
I think I know why. It's because it conflicts with the C# UI thread. So I will try to call it in an asynchronous way
Sign in to participate