win32utils-devel@rubyforge.org
2004-Feb-05 17:58 UTC
[Win32utils-devel] Service event hooks question
In order to be able to call event hooks as I mentioned previously it
looks like I''ll have to do something like this in Service_Ctrl():
// For example
if(dwCtrlCode == SERVICE_CONTROL_STOP){
rb_funcall(self,rb_intern("send"),rb_intern("on_stop"));
}
There are a few problems. First, I''m not sure I''m calling
that
properly. Second, I don''t know how to get "self" into the
method - I
making cDaemon global and passing that but it didn''t seem to work.
Third, this syntax doesn''t cause an error but it doesn''t seem
to
actually work.
Any ideas?
I suppose I should add a "respond_to?" for each of the hooks as well.
Regards,
Dan
win32utils-devel@rubyforge.org
2004-Feb-05 20:31 UTC
[Win32utils-devel] Service event hooks question
Hi,> > In order to be able to call event hooks as I mentioned previously it > looks like I''ll have to do something like this in Service_Ctrl(): > > // For example > if(dwCtrlCode == SERVICE_CONTROL_STOP){ > rb_funcall(self,rb_intern("send"),rb_intern("on_stop")); > } > > There are a few problems. First, I''m not sure I''m calling that > properly. Second, I don''t know how to get "self" into the method - I > making cDaemon global and passing that but it didn''t seem to work. > Third, this syntax doesn''t cause an error but it doesn''t seem to > actually work. > > Any ideas? > > I suppose I should add a "respond_to?" for each of the hooks as well. > > Regards, > > Dan >I committed new version of service.c. Now default hooking function can be called without explicit hooking. Regards, Park Heesob --MIME Multi-part separator--