Load C++ Library In-Process or Out-of-Process - MATLAB & Simulink (original) (raw)

Main Content

Load Out-of-Process C++ Library

MATLAB® can run C++ functions in a separate process. Running in a separate process enables you to:

To run out-of-process, in your workflow script created by the clibPublishInterfaceWorkflow function, run the Enable out-of-process execution mode section. Alternatively, from the command line, call theclibConfiguration function with the "ExecutionMode" argument set to "outofprocess".

Unload Out-of-Process C++ Library

If you run the Enable out-of-process execution mode section in the workflow script created by the clibPublishInterfaceWorkflow function, then you can unload the C++ library by running the Unload out-of-process library section.

Alternatively, call unload on the MATLAB interface. For example, suppose that you built an interfaceschoolInterface.dll to the school C++ library and the interface is loaded and set to out-of-process execution. To verify, type:

configObj = clibConfiguration("school")

configObj =   CLibraryConfiguration for school with properties: InterfaceLibraryPath: "C:\work" Libraries: "" Loaded: 1 ExecutionMode: outofprocess ProcessID: 12345

To unload the library, type:

Information About the Host Process

Use the CLibraryConfiguration object created from calling theclibConfiguration function to get information about the host process. These properties provide information about the settings and status of a MATLAB interface to a C++ library.

See Also

Objects

Functions