buffer with undefined length 
Author Message
 buffer with undefined length

How can I give a buffer with undefined length to an
interface?


Sun, 13 Nov 2005 21:42:37 GMT  
 buffer with undefined length
If you mean you don't know the size at compile time then your method should
look something like:

HRESULT Method([in] short m, [in, size_is(m)] short a[]);

which means that the size of array a is m, which can vary vom call to call.

--
Best regards
Seiringer Martin

Quote:

> How can I give a buffer with undefined length to an
> interface?



Sun, 13 Nov 2005 22:16:01 GMT  
 buffer with undefined length
Actually, at compile time I use a void*, at run time I
use different buffers that have different size

Quote:
>-----Original Message-----
>If you mean you don't know the size at compile time then
your method should
>look something like:

>HRESULT Method([in] short m, [in, size_is(m)] short a[]);

>which means that the size of array a is m, which can

vary vom call to call.
Quote:

>--
>Best regards
>Seiringer Martin


>> How can I give a buffer with undefined length to an
>> interface?

>.



Mon, 14 Nov 2005 00:02:32 GMT  
 buffer with undefined length
Not do-able with this approach. Think of it from the point of view of the
marshaler. When it sees a "void *" it needs to know what to marshal, but the
"void" doesn't give it enough information.

Are you trying to transfer an abitrary number of bytes? You can still use a
conformant array, as suggested before, expressing it as:

HRESULT MyMethod ([in] long buffersize, [in, size_is(buffersize)] BYTE
*buffer);



Mon, 14 Nov 2005 00:30:35 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Buffer sizes and string lengths

2. TDS Buffer Length Too Large

3. CAsyncSocket and receive buffer length

4. socket buffer length

5. get data length in serial port buffer?

6. CString buffer length - how to increase and monitor?

7. Setting the receive buffer length does not work with CAsyncSocket

8. why is undefined behaviour undefined ?

9. Get length of file , not logical length , but amount

10. buffer and &buffer

11. &buffer == buffer??

12. Why does stdio buffers preceed iostream buffers ??? (console)

 

 
Powered by phpBB® Forum Software