 |
|
|
 |
|
 |
Ganesh,
Under which license have you released this code? Or, have you released this code into the public domain?
Thanks,
Andrew
|
|
|
|
 |
|
 |
its public, only one condition, if it breaks anything i am not responsible.
note: this is old code with bugs so beware....
|
|
|
|
 |
|
 |
Thanks so much for the quick response.
Much obliged,
Andrew
|
|
|
|
 |
|
 |
Ganesh,
Please forgive me. I didn't realize how picky my legal folk are. They need to see one of the following sentences:
“I place this code in the public domain,” or “This code is in the public domain.”
If you could reply with one of those sentences I would greatly appreciate it.
Again, I am sorry to keep bugging you about this.
Thanks,
Andrew
|
|
|
|
 |
|
 |
ok here we go - I place this code in the public domain .
you are free to edit/modify and use this code for any purpose.
again, i am not responsible for any damage that may happen because of using this code.
- ganesh
|
|
|
|
 |
|
 |
Thanks! That should make legal happy.
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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)
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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]
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
That's a good idea!
Thank you!
Good luck !
|
|
|
|
 |
|
 |
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
-
|
|
|
|
 |
|
 |
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?
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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.)
|
|
|
|
 |