View Single Post
Old 29 June 2020, 14:21   #5
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 821
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 View Post
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.

Last edited by Sim085; 29 June 2020 at 14:43.
Sim085 is offline  
 
Page generated in 0.06648 seconds with 11 queries