Click here to Skip to main content
15,900,108 members
Home / Discussions / C#
   

C#

 
GeneralRe: PrintScreen and saving to an Image object Pin
Polis Pilavas7-May-05 14:07
Polis Pilavas7-May-05 14:07 
GeneralRe: PrintScreen and saving to an Image object Pin
WujekSamoZlo7-May-05 23:36
WujekSamoZlo7-May-05 23:36 
GeneralRe: PrintScreen and saving to an Image object Pin
Polis Pilavas8-May-05 1:33
Polis Pilavas8-May-05 1:33 
GeneralRounding off integers Pin
katiebrennan7-May-05 10:16
katiebrennan7-May-05 10:16 
GeneralRe: Rounding off integers Pin
vladfein11-May-05 8:50
vladfein11-May-05 8:50 
GeneralRe: Rounding off integers Pin
MoustafaS7-May-05 11:17
MoustafaS7-May-05 11:17 
Generalquestion about bandobjects (toolbar for IE) Pin
Green Fuze7-May-05 8:31
Green Fuze7-May-05 8:31 
GeneralWindows Service - starnge stopping behaviour Pin
Member 14523617-May-05 8:02
Member 14523617-May-05 8:02 
Hi - any help with this would be greatly appreicated - it has already had me
confused for a good few hours! WTF | :WTF:

I am using Visual Studio 2003 and the .NET framework 1.1.

I have a C# Windows Service, with my own class extending from ServiceBase in
the normal fashion. The service starts a remoting object (WKO and
singleton) which many clients can then make calls on. Clients may also
register with events on the server such that the server will inform clients
when certain actions occur.

This all works fine and clients are appropriately notified when the server
fires the events.

However, I would like the clients to also be informed when the service is
stopping - and so I thought that firing an event in the service's overridden
OnStop() function would be ideal for this. I can see that the multicast
delegate on the server has the delegates to call upon so it seems the
clients have successfully registered their interest in the service shutting
down. I can prove this by firing the event at any time and all works well.
However, the strange behaviour I am seeing is that as soon as I break on
entry to the OnStop() method - the place where I need to fire the event -
the event/delegate member variable is null - someone (not me!) has clearer
all the delegates - so it appears that no one is interested in the service
shutting down - when there really are interested parties.

Does anybody know why this is happening? The service has member member
variables - some value types, some reference types, and they are all still
present and correct on entry to the OnStop() function, but any event member
variables have been cleared and are nulls.

Is this possibly as designed for some reason and Ive missed some piece of
documentation saying that events are cleared by the time the framework calls
OnStop for you?

Any help greatly appreciated.

Thanks,

Dan

Generaldata formatting in a textbox using c# Pin
NormBohana7-May-05 6:59
NormBohana7-May-05 6:59 
GeneralRe: data formatting in a textbox using c# Pin
Polis Pilavas7-May-05 14:13
Polis Pilavas7-May-05 14:13 
GeneralRe: data formatting in a textbox using c# Pin
NormBohana7-May-05 14:55
NormBohana7-May-05 14:55 
GeneralRe: data formatting in a textbox using c# Pin
Polis Pilavas7-May-05 14:59
Polis Pilavas7-May-05 14:59 
GeneralRe: data formatting in a textbox using c# Pin
NormBohana8-May-05 8:12
NormBohana8-May-05 8:12 
GeneralRe: data formatting in a textbox using c# Pin
Polis Pilavas8-May-05 9:48
Polis Pilavas8-May-05 9:48 
GeneralRe: data formatting in a textbox using c# Pin
NormBohana8-May-05 16:26
NormBohana8-May-05 16:26 
GeneralRe: data formatting in a textbox using c# Pin
Polis Pilavas9-May-05 1:36
Polis Pilavas9-May-05 1:36 
GeneralRe: data formatting in a textbox using c# Pin
NormBohana9-May-05 5:52
NormBohana9-May-05 5:52 
GeneralRe: data formatting in a textbox using c# Pin
Polis Pilavas9-May-05 9:38
Polis Pilavas9-May-05 9:38 
GeneralReading eno from Xml file and display in label of WInform Pin
ksanju10007-May-05 3:48
ksanju10007-May-05 3:48 
GeneralImage Processing Question Pin
Meysam Mahfouzi7-May-05 2:35
Meysam Mahfouzi7-May-05 2:35 
GeneralRe: Image Processing Question Pin
ekynox7-May-05 2:48
ekynox7-May-05 2:48 
QuestionDo you think this is stupid ? Pin
Sharpoverride7-May-05 2:30
Sharpoverride7-May-05 2:30 
AnswerRe: Do you think this is stupid ? Pin
Colin Angus Mackay7-May-05 2:58
Colin Angus Mackay7-May-05 2:58 
GeneralRe: Do you think this is stupid ? Pin
Sharpoverride7-May-05 3:00
Sharpoverride7-May-05 3:00 
GeneralRe: Do you think this is stupid ? Pin
Colin Angus Mackay7-May-05 3:23
Colin Angus Mackay7-May-05 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.