Service with event handling

Pelle75

New member
Joined
Oct 13, 2008
Messages
1
Programming Experience
3-5
Hi!

I hope someone can help me with this problem.
Simplified I have a made a windows service with a event handler.

In the Onstart methode the service connects to a process runing on the server...


VB.NET:
Dim WithEvents P As PMsgCtrl.ClsDekoder

[COLOR="SeaGreen"]Protected Overrides Sub OnStart(ByVal args() As String)

	
	P = CreateObject("PMsgCtrl.ClsDekoder", My.Settings.PMsgServerName)
	
	....

End sub[/COLOR]


And another methode handles events from the connected process...

VB.NET:
[COLOR="SeaGreen"]Private Sub P_MsgHandler(ByRef MsgName As String, ByRef sResult As String) Handles P.GetMsg

	...

end sub
[/COLOR]

The problem is that this code work fine in a windows forms application. But in a windows service there are no events. Why is it so?

Beste Regards
Pelle
 
Last edited by a moderator:
Youre using a windows control in a service and wondering why it raises no events? Maybe because it isnt visible to be interacted with and raise them?
 
Back
Top