Re: GetDataToBuffer/GetDataToBufferAt (General questions)
I am hoping that you would return the number of bytes actually written to the buffer during that method call, just as you already do for each of your buffered property retrieval commands (e.g., GetListItem, GetErrorText, etc.).
I have developed a workaround for using the GetDataToBufferAt method to retrieve an ASCII file, but it's pretty ugly. I use a freshly zeroed buffer for each successive call to the method -- when the size of the string returned is less than the buffer size, I know that I have reached the end of the file.
However, this will not work for BINARY files since 0x00 is a valid byte value in binary files.
I cannot access the DLL asynchronously from my application, so I am unable to use the GetAttributes method to invoke the Attributes callback in order to obtain the file size. If I could get the file size, I would be able to to use that as my boundary condition when calling GetDataToBufferAt.
The algorithm would be very straight forward if the bufferSize parameter for the GetDataToBuffer and GetDataToBufferAt methods was an int pointer -- the programmer would send in the buffer size and the DLL would return the actual number of bytes written into the buffer (like with GetErrorText, etc.).
Instead of going through the hassle of changing the existing interface, perhaps you could create a new version of those two methods that would use the int pointer?
Complete thread:
- GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-09, 16:54
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-09, 18:38
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-09, 21:38
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-09, 21:54
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-11, 19:54
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-11, 20:20
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-22, 17:26
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-22, 17:31
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-23, 20:09
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-23, 20:59
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-23, 20:09
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-22, 17:31
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-22, 17:26
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-11, 20:20
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-11, 19:54
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-09, 21:54
- Re: GetDataToBuffer/GetDataToBufferAt - Lyle, 2005-11-09, 21:38
- Re: GetDataToBuffer/GetDataToBufferAt - wodSupport, 2005-11-09, 18:38