Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how to catch native C exception from Matlab user-defined function?
Date: Tue, 3 Nov 2009 22:15:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 5
Message-ID: <hcqa18$m8c$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257286504 22796 172.30.248.37 (3 Nov 2009 22:15:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 22:15:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1611255
Xref: news.mathworks.com comp.soft-sys.matlab:582192


Assume a user-defined Matlab function (e.g. MyFunction) executes 'calllib' to call a function in a native C DLL and that the C function throws an exception (e.g. std::exception).   Can the user-defined Matlab function use a MException try/catch block to catch the native C exception?   If not, what is the recommended way to catch an exception thrown from within a native C DLL?

Thanks,

Ian