From the examples I found on the internet the hook is simply used to send messages back through IDCMP. Like that it works.
So is the hook function for STRING_KIND only to determine when to raise IDCMP messages back to solution?
For example I also tried to edit another gadget, but this also freezes the moment I try to refer to some function I have written.
Quote:
Originally Posted by mark_k
Maybe the hook function is called by input.device, not your task? Try having the hook function signal your task (which is a Process and so can call DOS functions) and do the printf from there.
|
Edit: Just to clarify, I can do everything through IDCMP. The reason I am asking the question is that I did not understand why it freeze when I was trying to do same things directly from the hook. From what I understand (now), this will fail as the hook code is not running as part of my process and therefore everything breaks when I think I am modify memory dedicated to my process when in reality this would not be the memory of my process. I suppose this is where the hook h_Data comes in.