🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #977

Re: How can I call the app server function from the client?

#977
From: Stefan
Date: Tue, 25 Jul 2000 00:00
34 lines
1611 bytes
the return value ist ONLY used to appoint success or failure to the calling
process.
to pass a return value you have to define a return-variable on server side.

------Server side ---------------
STDMETHODIMP TAppModul4Impl::GetTable(TVariant* vTableName,
  TVariant* ReturnValue)
{
    .
         // get Data
    .
      // -------------------------------------------------------------------
        // copy Data (TStringList) to Variant
        Variant v = VarArrayCreate(OPENARRAY(int, (0,Data->Count)),
varOleStr);
        for(int i = 0; i < List->Count; i++) {
            v.PutElement( WideString(List->Strings[i]), i);
        }

        // assign v to ReturnValue
        *ReturnValue = v;
        delete Data;
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IAppModul4);
  }
  return S_OK;
}

------Client side ----------------
Variant Data;
Data = dbCon->AppServer.Exec(Function("GetTable") <<
riant( String( "<TableName")) );
Technical Details
Message-ID: <397dbbd0_1@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8ke8p9$srn1@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,8beacdafd435851e
X-Google-Attributes: gidfcd2b,public
From: "Stefan" <srosehr@iits.de>
Subject: Re: How can I call the app server function from the client?
Date: 2000/07/25
Message-ID: <397dbbd0_1@dnews>
X-Deja-AN: 650596971
References: <8ke8p9$srn1@bornews.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Trace: 25 Jul 2000 09:09:52 -0800, 62.132.62.186
Organization: iits gmbh
X-MSMail-Priority: Normal
Reply-To: "Stefan" <srosehr@iits.de>
Newsgroups: borland.public.cppbuilder.database.multi-tier