Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MTS Object

Status
Not open for further replies.

birate

Programmer
Nov 19, 2002
1
TR
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top