Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 25th, 2004, 01:48 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default WinServices - Chapter 32 Pro C# 3rd Edition

Hi all, I hope someone can shine some light on the problem I seem to be having. I have created QuoteService, QuoteClient, QuoteServer, & TestQuoteServer. I install the service just fine but when I go to start it it starts & stops immediately. I get a message box that states "The QuoteService service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.". Can somebody please explain to me how to get around this because I've tried everything and can't seem to get it to work. The problem seems to be with QuoteServer because if I take out the calls to QuoteServer in the OnStart method and have it just write to a file then when I start the service it stays running but the minute I uncomment the calls to QuoteServer the same thing happens. I've downloaded the code off of this site to compare to what I wrote and they're identical. So now I'm really baffled as to what the problem is. Can anyone please help?

Thanks In Advance,
ALR
  #2 (permalink)  
Old November 7th, 2004, 03:02 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mateoc15
Default

I have had this same problem, although not with the same code. I created a service of my own from scratch to simply monitor the local hard drive for a file, and if it is found, perform an action.

Newbie, as far as your code, I know you may THINK you have identical code to the book, but have you actually compiled the code from the CD to make sure? I have smacked myself in the forehead a few times because I thought things were "identical" but I came to realize that one critical line or even just one CHARACTER was different. Just a suggestion.

However, some help on this from ANYONE, ANYWHERE would be greatly appreciated!

  #3 (permalink)  
Old March 3rd, 2005, 05:15 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To Get rid of this problem, I tried using a timer control to have the program wait for timer_elapsed event. It Worked !!!

Use the following lines of code in your InitializeComponent() method

private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.ServiceName = "Reciever1";
this.timer1.Interval = 60000; //60 Secs
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elap sed);
((System.ComponentModel.ISupportInitialize)(this.t imer1)).EndInit();

}
The last line is very important.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning JavaScript 3rd Edition r_1481 BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 0 November 2nd, 2007 02:24 PM
Commentary on XSLT 2.0 3rd Edition Doug Bell Wrox Book Feedback 1 December 6th, 2006 11:43 AM
Ch 6, Delegetes and Events, 3rd edition Obnox BOOK: Professional C#, 2nd and 3rd Editions 1 December 12th, 2005 08:45 AM
Linux programming 3rd edition msalihu BOOK Beginning Linux Programming, 3rd Edition 1 November 20th, 2005 12:05 PM
C# 3rd edition -chapter 25 fjgnena BOOK: Professional C#, 2nd and 3rd Editions 0 September 9th, 2004 03:47 PM



All times are GMT -4. The time now is 04:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.