OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Asen Mihalev (asen_at_SOLARIS.TECHNO-LINK.COM)
Date: Tue Aug 27 2002 - 06:42:16 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    If I get it right, the server is the one that prints the value. If this is
    so, then the reason is the wrong IDL definition.
    It must be as follows:

    HRESULT DoStuff( [in] float Num); // not [out]

    or

    HRESULT DoStuff( [in, out] float* pNum); // in case you change the value
    inside and want it back in the client

    The reason it works properly without a proxy is because in this case it is
    like a normal C function call.
    On the other side, when you use a proxy, the marshaller does not pass your
    parameter to the server side, since it has been declared as an [out]
    parameter.

    ----- Original Message -----
    From: "Peter Partch" <peterpartchPMCONSULT.COM>
    To: <DCOMDISCUSS.MICROSOFT.COM>
    Sent: Thursday, August 22, 2002 7:48 PM
    Subject: Re: Floating-point support in DCOM

    > I reread my post and thought that I'd better explain the comment about
    > "out". The following code will perform differently depending on if a
    > proxy/stub will be loaded. If no proxy stub, then the print will be 3.15,
    if
    > a proxy loads then the print will be 0
    >
    > if your IDL definition looks like
    >
    > HRESULT DoStuff( [out] float* pNum);
    >
    > and the client calls like so:
    >
    > float f = 3.15f;
    >
    > hr = pObj->DoStuff( &f);
    >
    > and the object is imlemented as:
    >
    > HRESULT XXX::DoStuff( float* pNum)
    > {
    > //print out the *pNum that was initialized by caller
    >
    > //do other stuff
    >
    > return S_OK;
    > }
    >
    > Peter Partch
    >
    > ----- Original Message -----
    > From: "Peter Partch" <peterpartchPMCONSULT.COM>
    > To: <DCOMDISCUSS.MICROSOFT.COM>
    > Sent: Thursday, August 22, 2002 9:26 AM
    > Subject: Re: [DCOM] Floating-point support in DCOM
    >
    >
    > > Post the IDL of the method signature that takes the float (are you sure
    > that
    > > you did not specify [out] for the parameter??)
    > >
    > > Peter Partch
    > >
    > > ----- Original Message -----
    > > From: "Pierre Martin-Dumont" <pmdumontCYBECTEC.COM>
    > > To: <DCOMDISCUSS.MICROSOFT.COM>
    > > Sent: Thursday, August 22, 2002 9:00 AM
    > > Subject: [DCOM] Floating-point support in DCOM
    > >
    > >
    > > > Hi everyone,
    > > >
    > > > I have a strange problem. I have an ATL COM server loading an
    > > inproc
    > > > ATL COM component. The component loaded by the server provides a
    > function
    > > > that simply format a message an push it in a file. The formatted
    string
    > > > includes a floating point value, in other words, I use the sprintf()
    > > > function with "%f". When the function is called be the server itself
    > > > (inproc), the formatted string is OK. The problem appears when a
    client
    > on
    > > > another machine uses the same function (I omit the details of getting
    > the
    > > > component interface by the way of the server for simplicity) the
    string
    > is
    > > > not OK: argument used for %f option is skipped:
    > > >
    > > > In proc: sprintf(myString, "This is a value %f
    %d
    > > > %d", aFloat, aInt, bInt); gives "This is a value 10.000000 25 26";
    > > > Out-proc: sprintf(myString, "This is a value %f %d %d",
    > > > aFloat, aInt, bInt); gives "This is a value 0, <anything> <anything>";
    > > >
    > > > It sounds like the proxy/stub component (server side) which is doing
    the
    > > > function call for the client apps does not support floating-point
    > > > operations...
    > > >
    > > > Does anyone already faced this kind of problem? Can anyone explain
    what
    > is
    > > > going on?
    > > >
    > > > Thanks for your support,
    > > >
    > > > Pierre
    > > >
    > > > ----------------------------------------------------------------
    > > > Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    > > > contains important info. Save time, search the archives at
    > > > http://discuss.microsoft.com/archives/index.html .
    > > > To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    > >
    > > ----------------------------------------------------------------
    > > Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    > > contains important info. Save time, search the archives at
    > > http://discuss.microsoft.com/archives/index.html .
    > > To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >
    > ----------------------------------------------------------------
    > Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    > contains important info. Save time, search the archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >
    >

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM