Can I call Windows API functions from a MEX file?

I would like to call Windows API functions from a MEX file.

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 2009

0 votes

Calling Windows API functions from MEX files has not been tested by MathWorks. Therefore we are not aware of all of the issues that this may cause.
Calling Windows API functions can easily affect the stability of a MATLAB session. Additionally, many Windows API functions require the handle to the window of the running executable process. This handle is not available within MEX files.
You may be able to get some of the functionality from Windows API functions by linking against the Windows API libraries and including the appropriate header files. However, again, this has not been tested and can easily render the MATLAB process unstable.
The Related Solution at the bottom of the page documents how to link against external dynamically linked libraries from a MEX file.

Plus de réponses (0)

Catégories

En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by