Hi,
1.) make sure the code that calls AlmSetProcAlarm is also in the 7-th
segment. Maybe the linker puts the address of the jmp table into
AlmSetProcAlarm(). This happened to us with notifications.
2.) You don't need (or even should not) call MemHandleSetOwner
3.) make sure you don't lock the resource too many times.
4.) Also protect your application, so it won't be deleted while having
an alarm set.
5.) codewarrior produces a code 0 resource which only holds a few bytes,
thus your 7-th segment might not be the 7-th code resource!
Merry&Happy
Miro Pomsar
Mehul Patel wrote:
Hi,
My application has 7 segments.. 7th segement is newly created segment in order
to solve the problem. I have put the function in this new 7th segment. It
contains only one function which I will pass in AlmSetProcAlarm().
When I get sleep request notification, I lock this new code resource using
following code and call AlmSetProcAlarm()...
h = DmGetResource(sysResTAppCode, 7);
if(h != NULL)
{
MemHandleSetOwner(h, 0);
MemHandleLock(h); //Lock the code resource...
DmReleaseResource(h);
AlmSetProcAlarm(PowerProc, 0, TimGetSeconds() + 5);
}
But it gives me Memory write error... After making this change atleast the
procedure gets called everytime...
My first segment is 59K and if I put "PowerProc" function in the first segment
and call AlmSetProcAlarm() it works the first time but not the second time.
Please provde some hint...
Regards,
Mehul Patel
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/