 |
|
|
Hi All ..
i'm trying to create a windows service this serives should call an external application ,, my problem is when i start the services it calls the application but i cant see it on the desktop ,, just in the task manager as a running process . this is my code :
* i'm using VS 2005
System.Diagnostics.Process.Start("C:\\Program Files\\s\\SS\\Manager.exe");
Thanks.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
hai,
here i have a coding problem i am not getting is "the service to run independently with out any reference to the status of application running in the end users system.and the service application to be an installable application and the service application should sync database between remote database server.
Please find me the way to do.
Thanks & regards sai
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
It is full of mistakes, many of which will cause memory leaks and crashes.
The XCString class doesn't even have a destructor, despite allocating memory. The function DWORD CXService::Dispatch() only returns an error code upon failure, and returns nothing upon success. The Windows API ControlService() is called in 4 different places with an invalid pointer to a SERVICE_STATUS structure.
And those were just the bugs I found at a quick glance.
Nice idea, but you really need to test the code before you post it.
|
| Sign In·View Thread·PermaLink | 3.75/5 (5 votes) |
|
|
|
 |
|
|
Hello Your code is not at all starting any service on Win2K Professional Environment. It is denying the access to start any services. What should I do to proceed? In fact what is the database locking for? Regards Sreekanth Muralidharan
Sreekanth Muralidharan, Corporate Systems Consultant [Embedded Systems], INDIA
|
| Sign In·View Thread·PermaLink | 1.56/5 (3 votes) |
|
|
|
 |
|
|
Hello Your service interface was just great let alone for some good documentation on how to use your classes. Could you please put a little bit more effort. Hat's off!! Regards
Sreekanth Muralidharan, Corporate Systems Consultant [Embedded Systems], INDIA
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I would like to know does windows services support System.Windows.Forms component such as timer and datagrid.
I know services doesn't run like window interface but could I create the forms components and use them in my windows services.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
My service application works fine in win2k...but when i try to start the service in winxp it crashes...
can anyone help me out...
Thanks, Smitha
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Its a nice idea but if you try to use it be aware it needs debugging and some redesign. it contains a lot of small bugs. For example the CXString class is full of memory overwrites and errors: 1.new is mixed with realloc. 2.new allocation does not include space for null(should be strlen(x) + 1)
|
| Sign In·View Thread·PermaLink | 5.00/5 (3 votes) |
|
|
|
 |
|
|
Hello,
I wrote a service, sometimes it start succesfully and sometimes it fails after throwing following error:
Could not start the Sample service on Local Computer. Error 1053: There service did not respond the start or control request in a timely fashion.
I have tested service on following os: Win 2k Pro, Win 2k Adv Server, Win 2k Server and Win 2k3.
Note: Sample is application name.
Please help me to reslove the above problem.
Thanks Deepak Bhatia
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
I am getting the same error?? SetServices status call if made continuosly doesn't work with wait hint or check pint.. Did you find the answer to that.
verinder
none
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Ok article, though I think it would be nice if there were a demo project. Your leaky CXString class allocateds dyn. mem like a whore giving sex, so I had to remove the whole thing and replace instances of it with std::string. Also, for the CXServiceManager class, should I really have to go thru it and figure out whats going on ? You had to test it (hopefully) so you must have had a demo project. One could easily glimpse at the demo project to get an idea of what steps you need to register the service. Overall, ok code (other than leaky string class), crappy article (w/ no explanations) = low mark from me
My kickass website !
@{${$dan}{c}{clark}}[1]
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Nice article and good idea.
I've created a couple of NT services in the past and have also created an out-of-process COM server as an NT service. My problems start when I try to create a data handling service (to extend data from hardare to other processes or even networked entities).
For my local applications I discovered that I couldn't use interprocess shared memory or File mapped memory to communicate between the service and an outside process. (Something to do with services running in protected kernel space?). I get failures when attempting to share memory between the two.
Anyway, I'm looking for a reliable fast means (other than COM which is too slow) to communicate or pass data to and from the service. My experience with COM seems to indicate that out-of-process COM RPC communications are an order of magnitude slower than other more conventional interprocess communication methods. Right now I'm leaning towards windows sockets (or pipes for same machine communications)
Any thoughts here? Has anyone successfully used interprocess shared memory with a windows service?
Any thoughts you have are appreciated.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
Hi Ganesh,
Thankx for a nice article. I am a newbie around here. I am from the Unix world, just trying to mix with the other side of the world
Thankx again.
(alias) Kumar
- Its not over until its over. - Superman -
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I wrote a multithreaded service for NT using these classes. My service works fine on 2000, but when I port it over to NT it does not like being stopped or paused. Any Ideas?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Munnet, I write one or two services per month in my work, I have no problem with NT or 2000, I don't use this class, I use my own classes, I don't know if this class is good or notm, but for the comments of the people is good. I have to say you a little diference betwen win2K and NT when runs a service. Under NT when a service is running if you ask for the currentdirectory, that is the directory when the servcie run, you will get the directory where the app is running, for example c:\My services\Servcie01, I must to suppouse that you use it for get the ini paths, etc. But under win2k the GetCurrentDirectory will returns the System32 Directory. When I discover this I start to get the directory where the app resides from the registry. For now is the only impiortant diference that I found between NT and Win2K that have a impact in my services, I found another dfferences but I don't think that these will don't make problems with your threads....
Best Regards
Carlos Antollini.
today is Friday!!! for all
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I'm looking to create an NT service that when running displays a task icon on startup. Does anyone have any MFC Code that will do this or should I just do it in plain old "C".
Thanks
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Better to use instead a control application displaying the tray icon.
The tray icon needs a shell, the service does not. Period.
The application will run after the user log on (the service does not need this, obviously, so without logon there is no shell and, therefore, no tray icons on task bar). So this tiny utility asks the service state, parameters etc. and depending on this, will perform the additional actions (change icon in tray, modify the context menu for the icon, notify the current logged user by various methods etc.)
To be totally by-the-book: a service should consists on several components: - the executable where service(s) resides + additional dll used by service(s) - the message dll(s) obtained using the Message Compiler (mc.exe) and built into a localized resource-only dll(s); - the service(s) control application (if the default provided by the operating system is not enough). You can implement there the user control codes that may be implemented by the services, the custom actions you may have etc. - the setup of the service (may be implemented by the service itself) - additional files (help, utility tools, batch files, etc.)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
You mean, the only way to have a service display a taskbar icon is to have your service exe call up another program using ShellExecute (-Ex) ? Regards Harry
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
There is always another way... 
A noninteractive service does NOT need (I said does not need, not 'is impossible') to have a tray icon. A tray icon - as any other GUI component - is a (part of) a window of the current shell. The shell is active only when an user is loggen on. So that means this icon must have a parent window owned by the service.
I suppose the taskbar icon is intended to be a mechanism intended for a visual interaction between the currently logged-on user and the service, for example, right-clicking the icon will appear a menu with Start, Pause, Stop etc. In order to call Shell_NotifyIcon with NIM_ADD we have to call CreateWindow from the service and provide a message loop.
And now comes the desktop: the service is running in - usually - LocalSystem (or in another account). Fact is, HWND is part of a desktop, the desktop is part of a window station, so that means the CreateWindow will take part in the desktop of service, not in the desktop of logged user. That's why, for example, a simple call of MessageBox from a service is totally unrecommended since the message box will display not on current user's desktop, but in the service's desktop - and nobody wants to connect to the server staying in a box a click close on a hundred on message boxes... 
There are several approaches - and for sure there can be more - for a service to interact with the current user, including a tray icon. Such examples can be almost any type of Windows applications or components, the so-called service control/manager programs and can be launched or not at shell startup, as any other such program does:
- SQL Service Manager probably is one of the best such examples of standard Windows applications that minimizes on tray at startup and can be opened normally or using a context menu; - a shell namespace extension that adds a new branch under My Computer (this way opens another infinte possibilities) where you can see your service (or all), display informations in a list view, execute menu and context menu commands, drag & drop executables.
I hope what I've written here can be helpful...
Cristian Amarie
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello Sardaukar,
I am interested in this topic. I tried to execute another process such as calculator when the service was starting up and the calculator could not show it's window in the user desktop. I greatly appreciate your kindness if you could give or show me a sample source code for a service to interact with the current user, including a tray icon.
Thanks in advance.
Minh Hoa
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Why do you lock the Database before starting the Service in "CXServiceManager::StartService(..)" ? GetLastError() form ::StartService() is : "The Database is locked".
Without LockDatabase() it works well.
RainerS
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Does this work with the rudimentary service support in Windows 95/98/ME? I've been looking for a class that will do both NT/2K and 95/98/ME services. Haven't found one yet that does both.
-- Michael McGarrah mcgarrah@ncsu.edu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |