Can services have forms?

  • Thread starter Thread starter jim
  • Start date Start date
J

jim

I thought that I read somewhere that services don't (or can't) have forms.

Is that true?
 
jim said:
I thought that I read somewhere that services don't (or can't) have forms.

Is that true?

A service doesn't use forms, because the service is meant to run unattended
once it's started/executed, with no user interfacing.

But a Windows desktop application using a form can communicate with with a
service application, just like you see a personal firewall UI that
communicates with its FW service application.
 
Mr. Arnold said:
A service doesn't use forms, because the service is meant to run
unattended once it's started/executed, with no user interfacing.

But a Windows desktop application using a form can communicate with with
a service application, just like you see a personal firewall UI that
communicates with its FW service application.

Do you know of any examples of this that I can learn from?
 
jim said:
I thought that I read somewhere that services don't (or can't) have forms.

Is that true?

Nope, not true at all. A Windows Service can have all the forms it want.
There's even a handly little "Allow Service to Interact with Desktop" check
box you can explore in the service admin screen.

Now, as to the wisdom of having a Windows Service do Forms, that's another
story. If you go this route, you need to have a good answer for "What to do
if nobody is logged in?", and all of the edge cases around that.

Most people solve this by having the Service not have any Forms code, and
instead use a Remoting Proxy and an Admin Application. This seems to work
better. Just go look up "Remoting" and you'll find a number of examples all
over CodeProject.

If you want forms in your service simply for the sake of debugging, you can
take the hybrid approach:
http://www.coversant.com/dotnetnuke/Default.aspx?tabid=88&EntryID=19

The approach I talk about there works for Console and WinForms apps.
 
jim said:
Do you know of any examples of this that I can learn from?

This is a C# example and everything that's being done in C# as far as using
the namespace can be done in VB.NET as well.

http://www.codeproject.com/csharp/service_controller.asp

You can also issue custom commands to the service.

http://dotnetjunkies.com/Tutorial/C417F6B7-89E8-4502-B4D0-68B643EEF8A6.dcik

It's a one way communications, but you could create trigger files or other
means in the service to let the Windows application know that an event has
happened, as an example.
 
Oh, one other thing I like to do when debugging a service application,
particularly, when debugging a library that I have written that the service
is using and I need to send messages to help in the debugging is do NET Send
commands back to the workstation the service is running on. The Windows
Messenger service must be enabled on the machine so that messages can be
seen, with a popup message window being displayed.
 
Mr. Arnold said:
This is a C# example and everything that's being done in C# as far as
using the namespace can be done in VB.NET as well.

Are you aware that you are in a VB.Net newsgroup?
 
Are you aware that you are in a VB.Net newsgroup?

Are you aware that there is practically no difference beetween C# and
VB.Net?
 
jim said:
Are you aware that you are in a VB.Net newsgroup?

Yes, I am aware I am in a VB NG. However, most examples of things are in C#
..Net. You can search Google and see if you can find some examples in VB.

Once again, there is no difference between C# and VB.Net. The only
difference between the two languages are syntactical. You should be able to
take the C# example and come out with a VB example doing the same thing.
 
I comunicate with a few of my services with remoting

this might be an option for you to


Michel
 
Mr. Arnold said:
Yes, I am aware I am in a VB NG. However, most examples of things are in
C# .Net. You can search Google and see if you can find some examples in
VB.

Once again, there is no difference between C# and VB.Net. The only
difference between the two languages are syntactical. You should be able
to take the C# example and come out with a VB example doing the same
thing.

Unless you need pointers or anonymous delegates :-)
 
Blake said:
Unless you need pointers or anonymous delegates :-)

Exactly! C# and VB.Net are NOT the same. I am just learning VB.Net.

I hate .Net, but the job calls for it. I used to code in VB because I just
hate the syntax of C++. I like more verbose, natural languages. So, the
odds of me learning C# so that I can work in VB.Net are exactly zero.

jim
 
jim said:
Exactly! C# and VB.Net are NOT the same. I am just learning VB.Net.

I have been working with VB since 1996 and C# since 2004 and for the vast
majority of what the languages do in using the .NET Framework, which is what
we're talking about here. they do the same thing.

I hate .Net, but the job calls for it. I used to code in VB because I
just hate the syntax of C++. I like more verbose, natural languages.

What's a verbose and natural language? The only one that could fit that bill
would be Cobol. There is Cobol.NET too that you can use.

So, the odds of me learning C# so that I can work in VB.Net are exactly
zero.

No one is telling you to learn C#. But you should be sharp enough to use an
example in C#, as to what you can do in VB. But if you can't run with it,
you can't run with it. Find an example in VB if you can and move on.
 
Mr. Arnold said:
I have been working with VB since 1996 and C# since 2004 and for the vast
majority of what the languages do in using the .NET Framework, which is
what we're talking about here. they do the same thing.

Then show use how to do pointers and anonymous delegates in VB.Net. (And,
for the love of God, don't post another "here's how to do it on C# - you can
convert it" BS answer.)
What's a verbose and natural language? The only one that could fit that
bill would be Cobol. There is Cobol.NET too that you can use.

Again.....you are in the VB.Net newsgroup, Waldo.
No one is telling you to learn C#. But you should be sharp enough to use
an example in C#, as to what you can do in VB. But if you can't run with
it, you can't run with it. Find an example in VB if you can and move on.

You're the idiot that keeps posting C# examples to questions posted in a
VB.Net newsgroup!

I'm blocking you now......no need to respond.....

jim
 
Then show use how to do pointers and anonymous delegates in VB.Net.
(And, for the love of God, don't post another "here's how to do it on
C# - you can convert it" BS answer.)

Yes, but 95% if the applications out there don't need pointers or anonymous
delegates.

For those apps that rely on pointers so heavily - wouldn't C++ be a better
choice?
 
I'm blocking you now......no need to respond.....

Really? You can pull your head out from whatever holes you have it
buried in. You try to help a *clown* out, just give the *clown* an
example on how to do something, but the *clown* is too stupid to piss in
a boot straight. The *clown* starts whining.

My goodness, what a mule head you are with a head as hard as ten bricks
and can't see past your nose, which has got your entire face covered.

Is there a Pamper and bottle in house, so that I can change you? <g>
 
Spam said:
Yes, but 95% if the applications out there don't need pointers or anonymous
delegates.

For those apps that rely on pointers so heavily - wouldn't C++ be a better
choice?

I gave the *nut* some simple examples that used the
System.Processing.ServiceController namespace as the *nut* requested. A
two year old child can look at the examples in C# and say I need this
line of code, I need that line of code and how do I use the namespace in
VB.

C#

private ServiceController controller = new ServiceController();

VB

Dim controller as new ServiceController

Say it's not so that the *nut* can't figure it out.

Say it's not so that the *nut* couldn't use intellsense/early binding to
compare and do a here it is in C# and here is the equivalent in VB for
the statement.

The *nut* wants it handed to him on a silver tray so that he can use his
silver bowl, silver spoon, and silver baby bottle.

The *nut* can stick it up his silver behind.
 
The *nut* wants it handed to him on a silver tray so that he can use his
silver bowl, silver spoon, and silver baby bottle.

The *nut* can stick it up his silver behind.

Ya too many in this group want to be spoon fed.
 
Spam Catcher said:
Ya too many in this group want to be spoon fed.

Not me. I just want VB.Net answers in a VB.Net newsgroup. Posting C#
replies to requests for VB.Net examples is not only against the spirit of
this newsgroup, it is against logic.

I am sure that there is code written in C or C++ that may do what I am
trying to do. But, if I wanted C or C++ code I would be asking for help in
those newsgroups - like I should.

If people can't answer the question asked, instead of posting some jackass
response like "Google it" or some off-topic links to another language, they
should kindly stfu.

I don't even think anyone here knows how to accomplish this in VB.Net. Most
of the answers that I have seen offered here are simple ones that could have
been found by using the Help that comes with .Net.

I obviously chose the wrong place to ask this question.

My bad.

jim
 
We have Moses in the house. Moses has appeared and needs to put out a
few words.

And as Moses would say "IF YOU CAN'T LIVE BY THE LAW THEN DIE BY THE
LAW" as Moses tosses the VB tablets at the pagan C# pig. :)


They need to lock old Moses and the tablets up.
 
Back
Top