Re: Poke-ing memory allocated through Windows function
Jonas Temple wrote:
>
> All,
>
> Well, I fixed the code section I posted earlier to put HTML formatted text to
> the clipboard. No more memory problems so far (I'll post the updated code for
> any who are interested).
>
> What I'm curious about is: I thought Euphoria would not poke() to an address
> if it wasn't allocated through allocate(). In my clipboard code I had to use
> Window's GlobalAlloc to allocate the memory and then I wondered how to poke
> the data, either through another Windows function or poke(). I tried poke()
> and it worked.
>
> Can anyone clear this up for me?
>
> Jonas Temple
> <a href="http://www.yhti.net/~jktemple">http://www.yhti.net/~jktemple</a>
You can poke in any memory that is owned by your program.
When you used GlobalAlloc() you requested that the OS
assign some memory to your program therefore you can
poke in that allocated memory. The only thing I think
that you will need to be careful of is to release that
memory with the proper OS function because I don't think
Euphoria will do that for you. Euphoria manages it own memory
off the heap memory and releases it when Euphoria ends.
Bernie
My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, W32API
Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
|
Not Categorized, Please Help
|
|