M
Marco
Hello there,
We're new to C# and have noticed a strange behaviour which we don't
yet understand.
We wrote a COM DLL (in VC++ 6.0) which performs some calculation based
on some double arrays passed as input parameters to the DLL through
the SetParams method defined as follows:
interface ICliquet : IPricable
{
HRESULT SetParams([in]long double year_min, long double
monthly_floor,
long double monthly_cap, long double *
drift,
long double * volatility, long double *
dividend,
long double * timespan, long periods,
long double firstmonthquote, long double
rel);
};
(IPricable implements IDispatch)
We can properly add a reference to the COM object through the interop
by VStudio .NET which declares the double* as float64&.
The method works fine when used in a standalone C# application
(declaring the input arrays as...
double [] volatility = new double[1000];
....calls the COM method by...
obj.SetParams(...., ref volatility[0], ...)
The problem arises when doing the same in a C# WebService since the
double arrays are "cleared" (seem to be "zeroed") when passed to the
COM object!
No error is returned (the COM object works "fine" on zeroed input
data!).
It looks like a marshalling problem... the interop assemplies look the
same for both the WS and the standalone solution.
Any hitns?
Thank you!!!
-- Marco & Marcello --
We're new to C# and have noticed a strange behaviour which we don't
yet understand.
We wrote a COM DLL (in VC++ 6.0) which performs some calculation based
on some double arrays passed as input parameters to the DLL through
the SetParams method defined as follows:
interface ICliquet : IPricable
{
HRESULT SetParams([in]long double year_min, long double
monthly_floor,
long double monthly_cap, long double *
drift,
long double * volatility, long double *
dividend,
long double * timespan, long periods,
long double firstmonthquote, long double
rel);
};
(IPricable implements IDispatch)
We can properly add a reference to the COM object through the interop
by VStudio .NET which declares the double* as float64&.
The method works fine when used in a standalone C# application
(declaring the input arrays as...
double [] volatility = new double[1000];
....calls the COM method by...
obj.SetParams(...., ref volatility[0], ...)
The problem arises when doing the same in a C# WebService since the
double arrays are "cleared" (seem to be "zeroed") when passed to the
COM object!
No error is returned (the COM object works "fine" on zeroed input
data!).
It looks like a marshalling problem... the interop assemplies look the
same for both the WS and the standalone solution.
Any hitns?
Thank you!!!
-- Marco & Marcello --