Hi Jeff,
Thank you for the response...
I know that the segments may be moved by the OS in order to have efficient 
memory management and this is the reason ProcAlarm fails.

I understand your solution but don't know how exactly copy function to feature 
memory and pass that memory location to AlmSetProcAlarm().
I tried following but something is wrong here...

h = DmGetResource(sysResTAppCode, 7); 
if(h != NULL)
{
  void *ftrMem;
  void *data;  
  MemPtr procptr;
     
  //Lock the code resource & get the pointer... 
  procptr = MemHandleLock(h); 
  FtrPtrNew(appFileCreator,myFtrMemFtr,MemHandleSize(h)+10,&ftrMem); 
                                                                          
MemPtrSetOwner(ftrMem, 0);
  if (!FtrGet(appFileCreator,myFtrMemFtr, (UInt32*)&data)) 
          DmWrite(data, 0, procptr, MemHandleSize(h)+1); 

  MemHandleUnlock(h);
  DmReleaseResource(h);
  AlmSetProcAlarm((AlmAlarmProcPtr)ftrMem, 0, TimGetSeconds() + 2);
}
The code resource 7 contains only one function and that function does not 
access any static or global data and also does not point anywhere in my 
application.

Please be kind enough to write few lines of code to help me understand it 
better. Thank you!

Regards,
Mehul
-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to