Re: CMemFile::GetBufferPtr
The CMemFile will still report that it does not support direct buffering
m_bDirectBuffer is set to true for me after the call to
"m_pFile->GetBufferPtr(CFile::bufferCheck)&CFile::bufferDirect". Are you
still getting false?? If so, there may be something else going on.
If I remember correctly, FillBuffer is bypassed when using CMemFile (with a
supplied buffer) with CArchive and memory access is direct to/from the
buffer. A few months ago I went through the code pretty thoroughly to make
sure things were working the way I needed. Of course, I need to refresh my
findings :). I'll Take a look again later this evening or tomorrow morning.
Cheers,
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"XirisJohn" <XirisJohn@discussions.microsoft.com> wrote in message
news:B2478DF6-F9A0-493E-A5FE-EB10F8366E0B@microsoft.com...
Thanks Mark!
That certainly works, but it seems like a workaround to me. The CMemFile
will still report that it does not support direct buffering, and thus
there
will be an extra memmove_s in CArchive::FillBuffer. Not a big deal,
perhaps,
but I'm intrigued to know if there is a better way :-)
John