Calling PB 2019-R3 object from C++. I'm getting 'Unhandled Exception' in the error object and no exception in the C++ code. Any idea?
The PowerBuilder function:
public function integer of_exception (integer ai_value) throws n_cst_exception;n_cst_exception ex
Integer li_calc
ex = Create n_cst_exception
ex.SetMessage("Something went wrong!")
Throw ex
li_calc = ai_value * ai_value
Return li_calc
end function
The C++ code:
try
{
// Call the function
session->InvokeObjectFunction(pbobj, mid, &ci);
// Was PB exception thrown?
if (session->HasExceptionThrown())
{
// Handle PB exception
session->ClearException();
WriteToLogFile(L"PB exception");
}
}
catch (...)
{
// Handle C++ exception
WriteToLogFile(L"C++ exception");
}