Call the PowerBuilder function
From PowerBuilder Native Interface
Call the PowerBuilder function
// Set IN arguments. The prototype of the function is
// integer f_mult(integer arg1, integer arg2)
ci.pArgs-> GetAt(0)->SetInt(123);
ci.pArgs-> GetAt(1)->SetInt(45);
// Call the function
try
{
session->InvokeObjectFunction(pbobj, mid, &ci);
// Was PB exception thrown?
if (session->HasExceptionThrown())
{
// Handle PB exception
session->ClearException();
}
}
catch (...)
{
// Handle C++ exception
}
// Get the return value and print it to the console
pbint ret = ci.returnValue->GetInt();
fprintf(stderr, "The product of 123 and 45 is %i\n",
ret);