Example below:
classdef handleExample < handle
% ....
methods
function obj = handleExample(input)
% create Obj
end
function obj = doSomeThing(obj, input)
% ... lots of things
%
end
end
end
The constructor is then called in function which returns this "Handle":
function hOut = mwConstructor()
% ...
input = struct( 'a lot of fields', '');
hOut = handleExample(input);
return;
end
This function is added to the .dll exported functions as well as a wrapper:
function ret = wrapper(hObj, input)
%
hObj = doSomeThing(hObj, input)
ret = hObj.special_field;
return;
end
The wrapper is then called cyclic by a C++ application that makes use of the .dll that was generated by the MATLAB compiler.
But the results of "doSomeThings" seem to differ not just slightly, but in a really crazy way.