473,800 Members | 2,614 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any good links on how to thing when designing windows services

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
Dec 4 '07 #1
2 1267
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

"ch*******@gmai l.com" wrote:
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
Dec 4 '07 #2
On 4 Dec, 22:32, Peter Bromberg [C# MVP]
<pbromb...@yaho o.NoSpamMaam.co mwrote:
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 .comhttp://petesbloggerama .blogspot.comht tp://www.blogmetafin der.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
Dec 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
3618
by: matty | last post by:
Go away for a few days and you miss it all... A few opinions... Programming is a craft more than an art (software engineering, not black magic) and as such, is about writing code that works, first and foremost. If it works well, even better. The same goes for ease of maintenance, memory footprint, speed, etc, etc. Most of the time, people are writing code for a use in the *real world*, and not just as an academic exercise. Look at...
33
2898
by: Jerry Boone | last post by:
A long time ago Larry Linson (MVP contributor to this group) made a point to me that mdb's could do anything ADP's (Access Projects) could by using linked tables to leverage Sql server databases. It's been years since then, and I still sometimes think about that statement when evaluating the usefulness of the ADP's I build. Larry and I discussed this technique and he found it "Credible" (hope you don't mind me quoting you sir) so what the...
3
2380
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached response). My first reply directed me to source code migration but I didn't have the source code. The second reply mentioned about .NET interoperability (PInvoke I think) but I MENTIONED THAT I COULDN'T FIND ANY DOCUMENTATION FROM MSDN LIBRARY BASED ON...
0
864
by: gaurav tyagi | last post by:
is there any good book only for windows services (C#.NET)? i need a good book on windows service. i have C# Professional 3rd edition which has some thing about Windows services . but i want a complete book on windows services
20
2678
by: Dr. Colombes | last post by:
For a personal Web site with modest throughput and interactivity demans, I'm interested in your recommendation(s) for good (cheap, reliable, Linux friendly, very little, if any, sponsor advertising) Web site hosting company (in U.S.). Thanks!
63
3984
by: John Salerno | last post by:
I know there's a request for a good IDE at least once a week on the ng, but hopefully this question is a little different. I'm looking for suggestions for a good cross-platform text editor (which the features for coding, such as syntax highlighting, etc.) but not a full IDE with all the fancy jazz (GUI developer, UML diagrams, etc.). Ideally, it would be something I could even put on a flash drive and move from computer to computer, but...
13
3339
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new browser windows when clicked. I have found scripts that will allow one to open, and a few that claim to all multiples to be opened, but so far nothing that will allow a user to open multiple new windows as they click to see new samples. Does anyone...
2
1890
by: sck10 | last post by:
Hello, I created a class (public class General) with the following. My question is, is this good practice to have a group of methods(?) in one class, or should I have a separate class for each method? I'm not sure if this makes sense, but can/should you put more than one class in a file (myclasses.cs)? Any help would be appreciated... Thanks, sck10
0
1388
by: humbleaptience | last post by:
Hey Ya'll, I basically have a bunch of unix servers with a dataset scrambled through about 10 of them. On unix, I maintain a symbolic link file tree so that for each server it appears to have access to all the files through auto mounting and so forth. I want to be able to access this same file tree from my asp.net web app and NFS - however, it's not working and I've tried everything. Microsoft Services for Unix just doesn't cut it...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.