Thanks - I think I'm confused about how the constructor that lets you pass in a
memoryBlock is supposed to work.
If I do this, it works fine: the data is transferred.
dim m as memoryblock (...)
fm.CreateMemoryblock(id, m.size)
fm.deleteSharedMemory=false // the receiver will handle deleting it
(...)
fmv = fm.MapView(0,m.size)
dim buffer as MemoryBlock = fmv.Memory
if buffer <> nil then
m.CopyBytesMBS(0,m.size,buffer,0)
fmv.FlushView
fmv=nil
If I do this, the data ends up blank on the receiving end:
dim m as memoryblock (...)
fm.CreateMemoryblock(id, m.size)
fm.deleteSharedMemory=false // the receiver will handle deleting it
(...)
fmv = fm.MapView(m,0,m.size) // pass in our memoryblock
fmv.FlushView
fmv=nil
m= nil
In the second example, is the problem that I'm setting FMV to nil? Or that I'm
setting my MemoryBlock to nil?
On Jun 20, 2014, at 11:56 AM, Christian Schmitz
<[email protected]> wrote:
>
> Am 20.06.2014 um 17:46 schrieb Michael Diehr <[email protected]>:
>
>> I'm experimenting with FileMappingMBS. Is there a way to detach the memory
>> block received and then destroy the FileMappingView, without losing the
>> memory block? I'm trying to avoid an extra MemoryBlock copy if possible.
>
> doesn'T sound possible. Destroying the file mapping will not allocate new
> memory for the memoryblock.
>
> Sincerely
> Christian
>
> --
> Read our blog about news on our plugins:
>
> http://www.mbsplugins.de/
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> [email protected]
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info