> The problem is when I try to add my own patch, I always get the
following
> link error:
>
> __RuntimeModule__: 'GrfProcessStrokePatch' referenced from
> '__DummyStartup__' is undefined
>
> So now let me detail the settings of my patch:
>
> - as you guessed I'm patching GrfProcessStroke function,
>
> - I've added the corresponding TRAP resource 0xA292 of for that
function,
> exactly as it is done for the other patches in the sample project.
> ResID is 1002 (there are already two patches of ResID 1000 and 1001
in
> DemoHack)
>
> - I've created a new target called 'GrfProcessStrokePatch' by cloning
the
> settings
> from one of the already existing patches in the sample project
> (HackTemplate)
>
> - I've modified those settings accordingly to my patch, that is, in
68K
> Target :
> Project Type : PalmOS Code Resource
> File Name : patch1002.tmp
> Sym name : patch1002.sym
> Resource Name : GrfProcessStrokePatch
> Entry Point : GrfProcessStrokePatch
> ResType : CODE
> ResID : 1002
>
> - I've added a source file to my target called
GrfProcessStrokePatch.cpp :
>
> #include <PalmOS.h>
> #define myCreator 'XmpL'
> #define myResID 1002
>
> typedef Err (*myInterface)(PointType *startPtP, PointType
> *endPtP, Boolean upShift);
>
> Err MyGrfProcessStroke(PointType *startPtP, PointType *endPtP,
Boolean
> upShift);
>
> Err MyGrfProcessStroke(PointType *startPtP, PointType *endPtP,
Boolean
> upShift)
> {
> WinDrawChars("glop", StrLen("glop"), 50, 50 );
>
>
> return 0;
> }
>
>
> Of course I'm not doing anything yet in my patch, this is just a test,
but I
> still get that freakin
> link error !!
>
> I just don't get it ...
>
>
> PS: I have noticed that, with DemoHack, if I put my patch in a .c file
> rather than a .cpp file, I don't get the link
> error but the patch won't work.
OK. First, you really need to do your patch using a .c file -- when you
use a .cpp file, all of your function names get modified to include type
information. That is why the linker isn't able to find
'GrfProcessStrokePatch' -- it doesn't exist -- instead, you have
something like 'GrfProcessStrokePatch__6VJDE'. You can also just change
the entry point for your code resource -- this needs to be a real
function name.
As for your patch not working -- I don't know. You didn't show your
code for the GrfProcessStrokePatch function. WinDrawChars isn't the
best function to use -- it relies on a lot of system state -- what
happens if you don't have a valid drawing window when this is called?
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/