Gets the handle to the object returned by the last DotNetCallMethod call. The returned object handle has to be freed with DotNetFreeObject.
DotNetAPI.bdh
DotNetGetObject( in hObject : number, in nParamIx : number optional ): number;
object handle if successful
0 otherwise
Parameter | Description |
---|---|
hObject | Handle to a .NET Object |
nParamIx | Optional: If specified, gets the parameter index, else gets the last return value. |
dcltrans transaction TMain var hObject, hObject2 : number; hReturn : number; begin DotNetSetString(hObject, "ConstrValue1"); hObject := DotNetLoadObject("bin\\Release\\MyDotNet.dll", "MyDotNet.TestClass"); hObject2 := DotNetLoadObject("bin\\Release\\MyDotNet.dll", "MyDotNet.ParamClass"); DotNetSetFloat(hObject, 1.23); DotNetSetInt(hObject, 123); DotNetSetBool(hObject, false); DotNetSetObject(hObject, hObject2); DotNetCallMethod(hObject,"TestMethod"); hReturn := DotNetGetObject(hObject); DotNetFreeObject(hObject); DotNetFreeObject(hObject2); DotNetFreeObject(hReturn); end TMain;