[futurebasic] Re: [FB] Carbon event question: Is it possible to pass a pointer to a record in the userData param of InstallEventHandler? - I've tried but it don't work for me

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2004 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Thu, 9 Dec 2004 18:42:07 +1300
On 9 Dec 2004, at 02:07, bernie wrote:
> Is it possible to pass a pointer to a record in the userData param of 
> InstallEventHandler? - I've tried but it don't work for me
> TIA

Yes, but the object referenced by the pointer must be persistent, i.e. 
it must either reside in global var space or be an allocated memory 
block (NewPtr etc).  It must not reside in local var stack space, which 
becomes invalid/undefined as soon as its local fn exits and is then 
liable to get stomped/corrupted/overwritten.

Robert P.