DotNetGetString Function

Action

Gets the string return value of the last DotNetCallMethod call in sReturn. Parameter sRetLen defines the size of the sReturn string buffer.

Include file

DotNetAPI.bdh

Syntax

DotNetGetString( in    hObject : number,
                 inout sReturn : string,
                 in    nRetLen : number optional ) :boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hObject Handle to a .NET Object.
sReturn String buffer that will receive the return value of the last DotNetCallMethod call.
nRetLen Size of the string buffer passed in sReturn (optional).

Example

dcltrans
  transaction TMain
  var
    hObject, hObject2 : number;
    sReturnValue : string;
  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");
    DotNetGetString(hObject, sReturnValue);
    DotNetFreeObject(hObject);
    DotNetFreeObject(hObject2);
  end TMain;