Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

please help me to display MessageBox in WinServices applications which is created in vb.net.
and that messageBox contains the values which are retrived from Database.


Thanks,
parshu
Posted

1 solution

It's not a good thing to show a GUI in a service application.

Since a service could be running without any user logged in the messagebox (or any other GUI) would never be visible.
Further showing a messagebox in a service will effectively stop the service from running untill somebody clicks on the OK button.

Why do you want to do this?

Can't you write the output out to a log file?
 
Share this answer
 
Comments
Parshu2378 21-Apr-11 4:48am    
But my alerts are of three types are as follows...
1) Email
2) SMS and
3) OnScreen

i want to show the visitor name who is signed in office premises.
Email funtioanlity completed by attaching a created file.
Sergey Alexandrovich Kryukov 21-Apr-11 4:57am    
Rethink everything.
If your explain your ultimate goals, without requiring any specific technology, I could think of something. You could create a UI application and trigger it's loading on some events, communicate with Service; something like that. Best of all, either forget on-screen or Service.
--SA
Tom Deketelaere 21-Apr-11 5:02am    
Why do you want to do this with a service?

Can you explain what exactly your requirements are so we can suggest an alternate way to do this.

As Sakryukov said you will have to rethink your program. Either forget about using a service or forget about displaying anything on-screen.
Sergey Alexandrovich Kryukov 21-Apr-11 4:53am    
Correct. Parshu, don't even play with the idea of MessageBox, it won't work.
5 for this answer!
--SA
Sandeep Mewara 21-Apr-11 11:33am    
My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900