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 / Windows Forms / WinForm General / March 2007

Tip: Looking for answers? Try searching our database.

window service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinki - 15 Mar 2007 03:32 GMT
Hello Everyone,

  I have created a very simple window service. This window service in turn
is calling a function that exist in a windows form.
When I am trying to run this windows service. window service does not run
and start throwing error message.
Once I remove the windows form and put that same method in a class and call
that class from window service, It works. I was wondering is it possible to
run the window service that is calling a method in windows forms.

Thanks
Bryan Phillips - 15 Mar 2007 05:46 GMT
It is very dangerous to open forms inside a windows service.  You could
lock up the windows service or the server itself.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> Hello Everyone,
>
[quoted text clipped - 7 lines]
>
> Thanks
Marius Horak - 15 Mar 2007 10:18 GMT
> It is very dangerous to open forms inside a windows service.  You
> could lock up the windows service or the server itself.

I'm not sure what are you trying to say.
What is the differenve between windows service with a form and windows
service without a form?

MH
Ciaran O''Donnell - 16 Mar 2007 16:30 GMT
The windows service runs in a logon context which doesnt have an interactive
session to present the form in. Therefore they dont work. If you want a
windows form interface to run in the background then try looking at a
notifyicon instead of a service or potentially as well as.
Signature

Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com

> > It is very dangerous to open forms inside a windows service.  You
> > could lock up the windows service or the server itself.
[quoted text clipped - 4 lines]
>
> MH
Bryan Phillips - 16 Mar 2007 21:21 GMT
Basically, never instantiate a Windows Form inside a Windows Service.  
Don't use the .Net Print classes inside a Windows Service either.  
Ciaran's advice is wise and should be followed.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> > It is very dangerous to open forms inside a windows service.  You
> > could lock up the windows service or the server itself.
[quoted text clipped - 4 lines]
>
> MH

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.