Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I want to covert my .exe windows application to windows service. It works by Sql notification service, ie if an entry comes to Table program will fetch that entry. it has a begin invoke delegate so it wont support by windows service.


Thanks in advance
Anvas
Posted

If can do it if you throw out all code related to System.Windows.Forms. If your UI is well isolated from everything else, this is easy. If not, try to extract pure application logic, data processing, etc., everything not related to UI. If this is difficult, you better start from scratch, using your available application as a reference. Next time think thoroughly about isolation of different application layers.

Development of a Windows Service itself has a number of special considerations and difficulties, especially in testing/debugging.

Start here:
http://en.wikipedia.org/wiki/Windows_service[^],
http://msdn.microsoft.com/en-us/library/d56de412%28v=vs.100%29.aspx[^],
http://msdn.microsoft.com/en-us/library/y817hyb6.aspx[^].

—SA
 
Share this answer
 
Comments
Abhinav S 1-Feb-12 0:47am    
Correct. My 5.
Sergey Alexandrovich Kryukov 1-Feb-12 1:19am    
Thank you, Abhinav.
--SA
anvas kuttan 1-Feb-12 0:47am    
yes i am almost gone through every hope. i made my entire code to windows service but this sql notification service wont get invoke that time. i foun that Begin invoke method is fro system.controls may that is why that event not firing in windows service.
Sergey Alexandrovich Kryukov 1-Feb-12 1:18am    
What are you talking about? BeginInvoke is a part of Windows.Forms, you should throw it out anyway. Just forget it when it comes to Windows Service.
Wait a minute! Don't you think that Windows Service can have some UI? No. Forget it.

Better digest my information and consider accepting the answer formally (green button) -- thanks.
--SA
Rajesh Anuhya 1-Feb-12 0:56am    
Good answer, have my +5
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Feb-12 1:16am    
Helpful information, but "pretty simple" sounds a bit of exaggeration. :-)
Well, a 5.
--SA
Rajesh Anuhya 2-Feb-12 1:12am    
Thanks SA
--RA
Rajesh Anuhya 1-Feb-12 1:54am    
Thanks SA
--RA
thatraja 1-Feb-12 11:44am    
5!
Rajesh Anuhya 2-Feb-12 1:12am    
Thanks Raja
--RA
Unfortunately, UI cannot be converted into a Windows Service.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Feb-12 1:23am    
Somebody voted 1 for this question. This is stupid. Maybe your answer is not complete (but what is "complete"?), but what you say it true. I countered with my 5.
--SA
Abhinav S 1-Feb-12 1:24am    
It was a Platinum voter.
Thank you for the 5 and correction, SA.
thatraja 1-Feb-12 11:44am    
5!
Abhinav S 1-Feb-12 22:27pm    
Thank you thatraja.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900