Write a service-type DCOMProgramAfter running, you find that the service program cannot be started when the client is connected, but another application is executed. Finally, through online data research, we found that the following steps are required to configure DCOM as a service type.
1. Configure the service as administrator or your current login user.
On the Control Panel, select management tools-services and select your services from the service list. Double-click the properties page, select "Logon", select "accounts", and enter the account name and password.
Or use the program in the Registry key
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ <service name>.
2. Define DCOM as a service type.
You must specify the LocalService name in the DCOM guid. The method is as follows:
Open the Registry hkey_classes_root \ appid \ <DCOM guid> Add LocalService = <service name>
For example, my application is like this:
Hkey_classes_root \ appid \ {D2832CD1-F34B-496F-88D5-DBE79AF38470}
LocalService = xotecserver
If the application service program is interactive and a little different, you need to define it as follows:
change LocalService to _ LocalService, and then add ruaas = interactive user (Interactive User)
for example, my application is like this:
hkey_classes_root \ appid \ {D2832CD1-F34B-496F-88D5-DBE79AF38470}
_ LocalService = xotecserver
ruaas = Interactive User