Hi,
I am trying to do an MTS object which simply shows a form for user interaction and calls an AS/400 program with a single parameter (input and output). I am using a component "caoProgram" which performs the remote program call and my problem is about the different behavings of the caoProgram method "GetParm" which gets the returning parameters.
{Delphi 5}
procedure TcaoProgram.GetParm(index: Smallint; var type_: Smallint; var length: Integer; ?????VAR parameter: OleVariant); virtual;
begin
FReturnCode := FcwbProgram.cwbrcGetParm(index,type_,length,parameter);
// Raise exception if needed.
if FReturnCode <> cwbOK then
raise EcaoProgram.Create(GetErrMsg)
end;
function TcwbProgram.cwbrcGetParm(index: Smallint; var type_: Smallint; var length: Integer; parameter: OleVariant): Integer;
First of all, i consider why cwbrcGetParm's parameter is not a parameter by reference (may be the reason is vararray) . The definition does not cause a problem when GetParm is called within Delphi (I mean, in a standalone application). GetParm gets the returning parameter correctly. But when the method is called within my MTS object, parameter still keeps the same value as it was before entering to the method.
Do you have an idea? Please help.
I am trying to do an MTS object which simply shows a form for user interaction and calls an AS/400 program with a single parameter (input and output). I am using a component "caoProgram" which performs the remote program call and my problem is about the different behavings of the caoProgram method "GetParm" which gets the returning parameters.
{Delphi 5}
procedure TcaoProgram.GetParm(index: Smallint; var type_: Smallint; var length: Integer; ?????VAR parameter: OleVariant); virtual;
begin
FReturnCode := FcwbProgram.cwbrcGetParm(index,type_,length,parameter);
// Raise exception if needed.
if FReturnCode <> cwbOK then
raise EcaoProgram.Create(GetErrMsg)
end;
function TcwbProgram.cwbrcGetParm(index: Smallint; var type_: Smallint; var length: Integer; parameter: OleVariant): Integer;
First of all, i consider why cwbrcGetParm's parameter is not a parameter by reference (may be the reason is vararray) . The definition does not cause a problem when GetParm is called within Delphi (I mean, in a standalone application). GetParm gets the returning parameter correctly. But when the method is called within my MTS object, parameter still keeps the same value as it was before entering to the method.
Do you have an idea? Please help.