Click here to Skip to main content
15,888,610 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Windows Service Pin
Xiangyang Liu 刘向阳15-Jul-03 1:50
Xiangyang Liu 刘向阳15-Jul-03 1:50 
GeneralRe: Windows Service Pin
Xiangyang Liu 刘向阳15-Jul-03 1:59
Xiangyang Liu 刘向阳15-Jul-03 1:59 
GeneralRe: Windows Service Pin
Xiangyang Liu 刘向阳15-Jul-03 2:04
Xiangyang Liu 刘向阳15-Jul-03 2:04 
GeneralRe: Windows Service Pin
Heath Stewart15-Jul-03 5:15
protectorHeath Stewart15-Jul-03 5:15 
GeneralRe: Windows Service Pin
Heath Stewart15-Jul-03 8:46
protectorHeath Stewart15-Jul-03 8:46 
GeneralRe: Windows Service Pin
Heath Stewart15-Jul-03 12:44
protectorHeath Stewart15-Jul-03 12:44 
GeneralRe: Windows Service Pin
Heath Stewart16-Jul-03 9:04
protectorHeath Stewart16-Jul-03 9:04 
GeneralRe: Windows Service Pin
Heath Stewart16-Jul-03 13:26
protectorHeath Stewart16-Jul-03 13:26 
Yes, when you call the executable with command line parameters, the parameters are passed to the main method. How many times do I have to say that the SCM (which merely invokes executables, but the command-line in the SCM is not passed to the application's entry point method (ex, main). The executable loader on the system passes params to the entry point method, which is what you're doing. Either way is fine, but the SCM is not passing these params - the executable loader is. I am making a point here - not saying which way is right or wrong - and you don't seem to be getting that.

The only thing that is wrong with what you're doing is that it's a lot easier to change a single registry parameters than to read-in the command-line for your service (because you should never assume the user took the default path or didn't change the location), change the parameters in the executable (which can be difficult to parse at times), then write it back out to the registry. Reading values from the registry or, better yet, a config file is much easier to manage and easier for users to change (the registry keys for a service are deep and often hard to find since you have to know the actual service name, not the display name of the service - unless you do an exhaustive find).

If you don't get the point I'm trying to make, then I'm sorry - you don't understand how executables are loaded on a system and how the SCM interacts with the service which all comes down to Win32 calls, which you obviously don't understand either. If you don't want to take the time to learn, then do it however you want and be completely ignorant about what is actually happening in the background.

 

Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN

GeneralRe: Windows Service Pin
Valeria Bogdevich17-Jul-03 4:46
Valeria Bogdevich17-Jul-03 4:46 
GeneralDirectShow .NET HELP!!! Pin
Brian JR14-Jul-03 8:15
Brian JR14-Jul-03 8:15 
GeneralRe: DirectShow .NET HELP!!! Pin
Heath Stewart15-Jul-03 8:50
protectorHeath Stewart15-Jul-03 8:50 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR15-Jul-03 17:50
Brian JR15-Jul-03 17:50 
GeneralRe: DirectShow .NET HELP!!! Pin
J. Dunlap15-Jul-03 18:03
J. Dunlap15-Jul-03 18:03 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR16-Jul-03 8:58
Brian JR16-Jul-03 8:58 
GeneralRe: DirectShow .NET HELP!!! Pin
J. Dunlap17-Jul-03 8:41
J. Dunlap17-Jul-03 8:41 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR17-Jul-03 8:57
Brian JR17-Jul-03 8:57 
GeneralRe: DirectShow .NET HELP!!! Pin
J. Dunlap17-Jul-03 11:50
J. Dunlap17-Jul-03 11:50 
GeneralRe: DirectShow .NET HELP!!! Pin
Heath Stewart16-Jul-03 4:56
protectorHeath Stewart16-Jul-03 4:56 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR16-Jul-03 9:10
Brian JR16-Jul-03 9:10 
GeneralRe: DirectShow .NET HELP!!! Pin
Heath Stewart16-Jul-03 9:21
protectorHeath Stewart16-Jul-03 9:21 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR16-Jul-03 15:40
Brian JR16-Jul-03 15:40 
GeneralRe: DirectShow .NET HELP!!! Pin
Heath Stewart17-Jul-03 1:21
protectorHeath Stewart17-Jul-03 1:21 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR17-Jul-03 8:49
Brian JR17-Jul-03 8:49 
GeneralRe: DirectShow .NET HELP!!! Pin
Heath Stewart17-Jul-03 8:51
protectorHeath Stewart17-Jul-03 8:51 
GeneralRe: DirectShow .NET HELP!!! Pin
Brian JR16-Jul-03 15:46
Brian JR16-Jul-03 15:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.