ScrDrawChars is an undocumented, low-level function that doesn't appear to be
used any more. Instead, the OS now takes a different path from WinDrawChars to
the low-level character drawing routines. Merely recompiling with the 3.5 SDK
will not change anything.

Not that I can recommend patching traps, but why not patch WinDrawChars instead?

-- Keith






[EMAIL PROTECTED] on 07/06/2000 01:09:12 AM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  [EMAIL PROTECTED]


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  Patching a trap in OS 3.5 vs. OS 3.0



Hi,

I hope I'm not repeating anything already discussed here.

I have a piece of code that used to patch ScrDrawChars trap for me. The problem
is, it's not working on PalmOS 3.5 anymore. When I try to debug my source codes,
the program never enters MyScrDrawChars() now, i.e. standard trap is being used.

Might be a stupid question, but: Do I need to recompile my project using SDK 3.5
for it to work on OS 3.5? And if I do so, will the
application still work on the older OS versions? Or is there something else that
I'm doing wrong.

Thanks,
Sebastian

--------------------------------------------------------
void (*OldScrTrap)(WinPtr, SWord, SWord,
       SWord, SWord, SWord,
       SWord, SWord, SWord,
       CharPtr, Word, FontPtr);

extern void MyScrDrawChars(WinPtr pWindow, SWord xLoc, SWord yLoc,
       SWord xExtent, SWord yExtent, SWord clipTop,
       SWord clipLeft, SWord clipBottom, SWord clipRight,
       CharPtr chars, Word len, FontPtr fontPtr)
{
      // ...
      // do some operations on chars
      // ... and call the standard function:
      (*OldScrTrap)(pWindow, xLoc, yLoc,
        xExtent, yExtent, clipTop,
        clipLeft, clipBottom, clipRight,
        chars, len, fontPtr);
}

--------------------------------------------------------
// and this patches the trap at the beginning of my app
(VoidPtr)OldScrTrap = SysGetTrapAddress(sysTrapScrDrawChars); //0xa0ed
SysSetTrapAddress(sysTrapScrDrawChars, &MyScrDrawChars);

--------------------------------------------------------
















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





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

Reply via email to