re: Camera Library Load/Remove and Invalid Chunk Pointer

2005-06-13 Thread Andrew Waites
Okay,

Eventually found this one. 

The Codewarrior code was mapping the cmdPBP to the correct structure using 

   mPowerCtx = (TmPowerCtx)cmdPBP

which worked fine for the Codewarrior code but when this same structure was 
passed back in the callframe to SysUIAppSwitch it did not pass back correctly 
after the called application did a

  MemPtrSetOwner(mPowerCtx,0);
  SysUIAppSwitch(yada yada yada)

On returning to the yada yada application it failed to correctly access the 
cmdPBP - it could actually read it fine but the emulator (bless its little 
cotton sox) threw lots of error reading unowned chunk type messages (that lazy 
slob simulator said nothing). Anyway, the simulator/emulator would finally blow 
a gasket when trying to exit this app.

  Solution was to:

  mPowerCtx = MemPtrNew(sizeof(TmPowerCtx));
  MemMove(mPowerCtx,cmdPBP,sizeof(TmPowerCtx));

  instead of

  mPowerCtx = (TmPowerCtx)cmdPBP;

But I guess everyone else in the world knows this.

rgds


-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/


Camera Library Load/Remove and Invalid Chunk Pointer

2005-06-12 Thread Andrew Waites
Hi,

Please bear with me while I explain a fairly complex (at least to me) setup 
which is causing an Invalid Chunk Pointer.

I have one application (written in PocketStudio although I'm pretty sure that 
is not relevant) calling a second app (Codewarrior) which (in its simplest 
form) does a find library, load library, CameraLibraryOpen, TurnPreviewOn  
then TurnPreviewOff, CameraLibraryClose, SysLibRemove then does a 
SysUIAppSwitch back to the calling application.  This all works fine but when I 
go to close the calling application I get an Invalid Chunk Pointer.  This 
happens if I only load and remove the library (no camera library open/close) 
but does not happen if I don't touch the library in the called routine so it 
looks strongly like it is related to loading and removing the library.

The remove library is not throwing an error.

I also tried switching back to a different app but same result - the switch 
back works but I get the invalid chunk ptr on closing THAT app. 

I noted the lack of support for library loading on simulators but sadly I get 
identical behaviour on the device.

Any ideas what further investigation I can do into this?

thanks
Andrew Waites
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/