Root > Reference > Main routines > Exception2HRESULT

Function Exception2HRESULT

Previous pageReturn to chapter overviewNext page   

Converts an exception into HRESULT value to be returned from DLL.

 

Unit

EAppDLL

 

Syntax

 

Code (Delphi)

function Exception2HRESULT(

const AExceptObject: TObject;

const AExceptAddr: Pointer;

const AClassName: String = '';

const AInvokeEurekaLog: Boolean = True;

const ASafecall: Boolean = True

): HRESULT;

 

Return value

HRESULT value to be returned to the caller.

 

Remarks

This is a helper function, which can be used when implementing safecall. See for more info. See also.

 

Examples

 

Code (Delphi)

function Test: HRESULT; stdcall;

begin

try

// Your actual payload (work) code should be placed here

except

Result := Exception2HRESULT(ExceptObj, ExceptAddr);

end;

end;

 




Send feedback... Build date: 2026-03-31
Last edited: 2026-03-31
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_EAppDLL_Exception2HRESULT