1. Callbacks

Hi Eutopia

I want to ask if the callback mechanism has to do with the
non-multithreading (or, maybe more correctly, the interprented) nature
of Euphoria. I have problems with a program with more than one
callback functions (the one, of course, is the main WndProc) which
seem to be called asynchrounsly.

 Thanks
-George-
 ---------
 EUZE{I}N

new topic     » topic index » view message » categorize

2. Callbacks

------=_NextPart_000_004D_01BEFD65.0A17AAC0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,

I'm working with dynamic subclassing and would like to know if when I am =
done with a previously defined callback can I use free() to clear it? Or =
will this do bad things.. I have already restored the old callback using =
SetWindowLong.

Any help would be appreciated!

Thanks,

Greg Harris


------=_NextPart_000_004D_01BEFD65.0A17AAC0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi All,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>I'm working with dynamic subclassing and would like =
to know if=20
when I am done with a previously defined callback can I use free() to =
clear it?=20
Or will this do bad things.. I have already restored the old callback =
using=20
SetWindowLong.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Any help would be appreciated!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Thanks,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Greg Harris</FONT></DIV>

------=_NextPart_000_004D_01BEFD65.0A17AAC0--

new topic     » goto parent     » topic index » view message » categorize

3. Re: Callbacks

Greg Harris writes:
> I'm working with dynamic subclassing and would like to
> know if when I am done with a previously defined callback
> can I use free() to clear it? Or will this do bad things.. I have
> already restored the old callback using SetWindowLong.

free() can only be used to free a block of memory allocated
using allocate() or allocate_string(). If you try to free a
callback address, it might work most of the time, but don't
count on it always working.

callback() returns an address that you can use to call
a Euphoria routine from Windows or a C routine.
callback() allocates some memory for this, but it's a small
amount - about 80 bytes. Once you get a callback address
for a Euphoria routine, you can use it for the rest of the program.
I don't see much need for freeing this space. If you have
a hundred different callback routines, you only need 8000 bytes.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Callbacks

Robert,

Thanks for the information!

Regards,

Greg Harris

----- Original Message -----
From: Robert Craig <rds at ATTCANADA.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, September 13, 1999 9:52 PM
Subject: Re: Callbacks


> Greg Harris writes:
> > I'm working with dynamic subclassing and would like to
> > know if when I am done with a previously defined callback
> > can I use free() to clear it? Or will this do bad things.. I have
> > already restored the old callback using SetWindowLong.
>
> free() can only be used to free a block of memory allocated
> using allocate() or allocate_string(). If you try to free a
> callback address, it might work most of the time, but don't
> count on it always working.
>
> callback() returns an address that you can use to call
> a Euphoria routine from Windows or a C routine.
> callback() allocates some memory for this, but it's a small
> amount - about 80 bytes. Once you get a callback address
> for a Euphoria routine, you can use it for the rest of the program.
> I don't see much need for freeing this space. If you have
> a hundred different callback routines, you only need 8000 bytes.
>
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    http://www.RapidEuphoria.com
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu