[prev in list] [next in list] [prev in thread] [next in thread]
List: ms-atl
Subject: Re: Marshaling custom interfaces (Safear
From: Richard Blewett <richardb () SIS ! SECURICOR ! CO ! UK>
Date: 1998-09-29 16:13:31
[Download RAW message or body]
Shouldn't it be
HRESULT GetDeltas( [out] long* pnDeltas,
[out, size_is( ,*pnDeltas )] double*** pDeltas ); ??
OK, no it shouldn't
Richard
-----Original Message-----
From: girishb@MVPS.ORG
Sent: 29 September 1998 16:04
To: ATL@DISCUSS.MICROSOFT.COM
Subject: Re: Marshaling custom interfaces (Safear
--------------------------------------------------------------------------
--
Shouldn't it be
HRESULT GetDeltas( [out] long* pnDeltas,
[out, size_is( ,*pnDeltas )] double** pDeltas ); ??
Girish Bharadwaj
-----Original Message-----
From: Alex Fostiy <alex.fostiy@CYBERSTAR.COM>
To: ATL@DISCUSS.MICROSOFT.COM <ATL@DISCUSS.MICROSOFT.COM>
Date: Tuesday, September 29, 1998 10:58 AM
Subject: Re: Marshaling custom interfaces (Safearrays in particular)
>I think that GetDeltas declaration should look like this
>HRESULT GetDeltas( [out] long* pnDeltas,
> [out, size_is( ,*pnDeltas )] double* pDeltas );
>
>Cheers,
>Alex
>-----Original Message-----
>From: Michael Hupp <mhupp@TI.L-3COM.COM>
>To: ATL@DISCUSS.MICROSOFT.COM <ATL@DISCUSS.MICROSOFT.COM>
>Date: Tuesday, September 29, 1998 7:44 AM
>Subject: Re: Marshaling custom interfaces (Safearrays in particular)
>
>
>Hello,
>
>Why would you mess with SAFEARRAYs if this is a custom interface? IMHO,
the
>code necessary to work with SAFEARRAYs is horrific! Why not use:
>
>HRESULT GetDeltas( [out] long* pnDeltas,
> [out, size_is( nDeltas )] double* pDeltas );
>
>HRESULT GetDeltas( long* pnDeltas, double* pDeltas )
>{
> // pointer checking code ommited
> *pnDeltas = 0;
>
> *pDeltas = (double*) CoTaskMemAlloc( sizeof( double ) * m_nDeltas );
> // pointer checking code ommited, again
>
> // fill the pDelta array
>
> *pnDeltas = m_nDeltas;
>
> // Don't forget to CoTaskMemFree in the Client
> return S_OK;
>}
>
>Unless I am missing something here, I would only mess with SAFEARRAYs if
the
>interface needed to be dual so V(Ack)B could use it.
>
>Good luck,
>Michael
>
>On Mon, 28 Sep 1998 14:48:14 -0700, Shrirang Moghe
><shrirang.moghe@AUTODESK.COM> wrote:
>
>>I searched the archives but didn't see any related postings. Here is
what
>>I see:
>>
>>I used ATL to write an EXE with one custom interface. The custom
>>interface has two methods in particular that deals with [in, out]
>>SAFEARRAYs. Now other client EXE uses this interfaces
>>
>>What I notice is that all the methods except the two (SAFEARRAY) based
>>fail. They don't even go across to the server. I built the proxy/stub
dll
>>from the generated files and registered it.
>>
>>Intrestingly, if I make the custom interface in to a dual, it works.
That
>>hints to to the fact that it is a marshaling related problem. One more
>>interesting fact is that if I substitute the SAFEARRAY declaration to
>>MIDL array it works!!!. I am running NT 4.0.
>>
>>Has anybody run in to a similar problem ?
>>
>>The failing custom interface method :
>>
>>HRESULT GetDeltas ([in, out] SAFEARRAY (double) *deltas)
>>
>>Appreciate your help.
>>
>>Regards,
>>Shrirang A. Moghe
>>
>>----------------------------------------------------------------
>>Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
>>contains important info including how to unsubscribe. Save time,
search
>>the archives at http://discuss.microsoft.com/archives/index.html
>
>----------------------------------------------------------------
>Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
>contains important info including how to unsubscribe. Save time, search
>the archives at http://discuss.microsoft.com/archives/index.html
>
>----------------------------------------------------------------
>Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
>contains important info including how to unsubscribe. Save time, search
>the archives at http://discuss.microsoft.com/archives/index.html
----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe. Save time, search
the archives at http://discuss.microsoft.com/archives/index.html
----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe. Save time, search
the archives at http://discuss.microsoft.com/archives/index.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic