jess5503
asked on
Running a service
Hi,
I have downloaded a c program from
http://www.csdn.net/dev/Visual%20C++/source%20code/Misc/nt_service.shtml.htm#build
I have successfully compiled it as an exe file and I was able to register it as a service using the command regsvr32 in windows 2000. I had this service(does nothing) running in my pc for 1 to 2 weeks and now when I tried to uninstall it using regsvr32 -u, it gives an error
"Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
Dllname is not a .dll or .ocx file."
I tried to create another program to try to register another service and it gives the same error. I tried to run the program in another computer and it still gives the same error. I do not know what cause the problem but I find it very weird that I can register it previously, but was unable to unregister it now.
Thank You in advance.
I have downloaded a c program from
http://www.csdn.net/dev/Visual%20C++/source%20code/Misc/nt_service.shtml.htm#build
I have successfully compiled it as an exe file and I was able to register it as a service using the command regsvr32 in windows 2000. I had this service(does nothing) running in my pc for 1 to 2 weeks and now when I tried to uninstall it using regsvr32 -u, it gives an error
"Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
Dllname is not a .dll or .ocx file."
I tried to create another program to try to register another service and it gives the same error. I tried to run the program in another computer and it still gives the same error. I do not know what cause the problem but I find it very weird that I can register it previously, but was unable to unregister it now.
Thank You in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>but I really do not know what causes the registration to stop working :(
How are you declaring 'DllRegisterServer()' and 'DllUnregisterServer()'? It should be like
extern "C" STDAPI __declspec(dllexport) DllRegisterServer(void);
extern "C" STDAPI __declspec(dllexport) DllUnregisterServer(void);
How are you declaring 'DllRegisterServer()' and 'DllUnregisterServer()'? It should be like
extern "C" STDAPI __declspec(dllexport) DllRegisterServer(void);
extern "C" STDAPI __declspec(dllexport) DllUnregisterServer(void);
ASKER
Hi,
Sorry, but I do not quite understand --> extern "C" STDAPI __declspec(dllexport) DllRegisterServer(void);
The files does not have DllRegisterServer or DllUnregisterServer. The program only calls RegisterService(__argc, __argv) in NTService.cpp during InitInstance(). The program will compile to an exe file.
Sorry, but I do not quite understand --> extern "C" STDAPI __declspec(dllexport) DllRegisterServer(void);
The files does not have DllRegisterServer or DllUnregisterServer. The program only calls RegisterService(__argc, __argv) in NTService.cpp during InitInstance(). The program will compile to an exe file.
>>The files does not have DllRegisterServer or DllUnregisterServer
So what exactly is unclear about "DllRegisterServer or DllUnregisterServer entry point was not found" then?
So what exactly is unclear about "DllRegisterServer or DllUnregisterServer entry point was not found" then?
ASKER
Hi,
Sorry, what I mean is that there is no function by the name of DllRegisterServer or DllUnregisterServer.
Sorry, what I mean is that there is no function by the name of DllRegisterServer or DllUnregisterServer.
ASKER
Hi,
AlexFM is right. I really made such a stupid mistake by trying to use regsvr32 to register the service. The main program actually calls the register function.
Thanks again.
AlexFM is right. I really made such a stupid mistake by trying to use regsvr32 to register the service. The main program actually calls the register function.
Thanks again.
ASKER
I have tried to use the -i and -i with -n but it still gives the same problem. Previously I tried, I was able to register it and unregister it but I really do not know what causes the registration to stop working :(