Skip to content

Instantly share code, notes, and snippets.

@constructor-igor
Last active December 25, 2016 09:27
Show Gist options
  • Save constructor-igor/6489a24dbaf8e5ec0f7751e8a23a700a to your computer and use it in GitHub Desktop.
Save constructor-igor/6489a24dbaf8e5ec0f7751e8a23a700a to your computer and use it in GitHub Desktop.
function obj = LoadNetDll()
dllPath = '<full path to folder with .NET dll>\';
if isdir(dllPath)
dllPath = fullfile(dllPath,'<.NET dll name>.dll');
end
a = NET.addAssembly(dllPath);
t = a.AssemblyHandle.GetType('<full .NET class name>');
obj = System.Activator.CreateInstance(t);
obj.SetDllsPath(dllPath);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment