Boost logo

Boost :

From: Phil Nash (phil.nash.lists_at_[hidden])
Date: 2003-02-20 13:12:59


[Anthony Williams]
> On Windows, for example, you can use GlobalAlloc to allocate some memory,
and
> you get an HGLOBAL back --- a handle to the memory. You need to call
> GlobalLock with that handle to get a pointer to the memory which you can
> actually use. The resource manager therefore needs to keep track of the
> handle, rather than the pointer (which may be different after different
calls
> to GlobalLock, if there has been an intervening GlobalUnlock). Indeed, the
> pointer to the locked memory is essentially a separate resource, acquired
with
> GlobalLock() and released with GlobalUnlock. It would be sensible to be
able
> to use the same framework for both the handle and the pointer.

This sounds like a perfect case where using a smart_PTR would be very
confusing, maybe dangerously so!

Err.. but just to be sure, are you saying this in support of smart_resource?

Regards,

[)o
IhIL..


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk