Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2007

Tip: Looking for answers? Try searching our database.

Any good links on how to thing when designing windows services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
christery@gmail.com - 04 Dec 2007 20:38 GMT
Jippie, got my first c# service working with XP/W2003srv (love
google), but got an hunch that vista will not support services that
uses GUI (can interact with desktop... checkbox in services gone?),

yepp (solution) can have 2 programs - one service and one normal GUI,
just wondering if anything else changes in the near future? sort of a
sneak peak into what trouble im haeding in to... gotta convert some
vb6 code soon that is like that will likely to be c# or vb.net for the
converted app... nice if I did it right the first time (for the first
time ;) )

we are not running vista, not eaven in the test env. we are sort of
staying of the (b)leeading edge, always wait until SP2 before u
upgrade to a new MS OS looks like a good iéa, so far anyway.

just wanna tap in to the thinktank ;)

Well, got rid of the last 2 OS/2 machines a year ago so im moving in
the right direction (?), but on the other hand didnt have any worries
about antivirus upgrades for those babys thease last years...

English isn´t my strong side, hope you can get heads or tails of what
I'm after...

//CY
Peter Bromberg [C# MVP] - 04 Dec 2007 21:32 GMT
having a service that interacts with the desktop is generally a very bad idea
anyway. The whole concept of a windows service is that it start with the OS -
before any real user has logged on. So if your service wants to do UI but
there is no desktop, what do you think will happen?

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

> Jippie, got my first c# service working with XP/W2003srv (love
> google), but got an hunch that vista will not support services that
[quoted text clipped - 21 lines]
>
> //CY
christery@gmail.com - 05 Dec 2007 07:29 GMT
On 4 Dec, 22:32, Peter Bromberg [C# MVP]
<pbromb...@yahoo.NoSpamMaam.com> wrote:
> having a service that interacts with the desktop is generally a very bad idea
> anyway. The whole concept of a windows service is that it start with the OS -
[quoted text clipped - 3 lines]
> --Peter
> "Inside every large program, there is a small program trying to get out."http://www.eggheadcafe.comhttp://petesbloggerama.blogspot.comhttp://www.blogmeta
finder.com

Shure, on my openVMS all logging goes to textfiles but this was a
"normal" VB6 program from the start that I made to a service to get
rid of the fact that I had to be logged in.

Well, it (UI) works in my VB6 service (when i found ntsvc.ocx or
whatever it was called some years ago), UI just showing what happens
(have to check box "can interact with desktop")- connect DB, read
file, update DB and so on, and more important what not when an error
occures, but (obviusly) only when support personel loggs in (no
special handling in code for that).

and yes i write log files with the same info, it makes life easyer if
the server stops for any reason to rule out my program, but that hasnt
happend /yet/ - havent used eventlogger in my VB6 service, in the C#
service I write to the eventlogg instead - no (G)UI there.

Looking for guidelines about programming services (ready/prepared for
the future development of windows), yes my app is threaded, no
racecondition what I can see, should be threadsafe *but* can one ever
be safe from bugs, dont think so....

had a worry about not using thread.sleep(5) in my while(true) loop, it
gets a bit slower but the service shoul never be able to drain all cpu
from the server, connecting to a RFID reader and that *should* take
250-700ms depending on read method, but if it goes wrong then I do
error logging and sleep 5 sek, the 5 ms delay is for an event where I
dont see that it goes wrong and it dosn´t take 250-700ms, then the
program would be like (worst case)

no real code, just how the program could behave

while(true) // should never stop reading
{
if (false) // an error occured that I didn´t expect, the false is the
return value from the reading of RFID, someone stole its static IP
address for ex.
{
}
}

so I put in a sleep in the main while loop just to be safe..

//CY

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.