Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2004, 09:53 PM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default Windows Service - Sevice Control (like) Program

I have created a windows service to serve as an "input manager" to a system. What is does is not really important. It just reads records in from a SQL server table, transforms the data into a new form and puts it in another SQL server table.

What I would like to do is create a service control program that can talk to my service and get information on what record is currently being processed and, perhaps change processing settings.

I looked into creating a Sevice Controller Program (SCP) but you really can just start and stop the service and send it an integer as a command with the ExecuteCommand() method.

As I said, I want to do more. Ideally, I'd like to setup a deal where my service has public properties and methods that can be called from an external "control" program. A sample property would just tell me what record is being processed. A sample method may be to tell the service to backup and start processing at a previous record for some reason.

The solution, I would think, would be like an old COM Server. An .EXE that one can get a handle to and the access the methods and properties. In COM you could do this with GetObject() for example.

I have considered writing TCP listeners and have also thought of DCOM, but it seems unnecessary to me if the programs are running on the same machine. I have also considered using Message Queue, which, again, seems like overkill.

An easy solution, of course, is to communicate through a SQL table. However, it seems like a waste to talk between programs like this when I ought to be able to locate the process running in memory and strike up an interprocess communication in memory.

Does anyone know of a way or how in .NET you can have two separate processes talk to each other like a COM Server. Again, these were the good old days, but I used to be able to open MS-Word, for example, and then run a VB program using the GetObject command that got a handle to Word, and then I could give Word commands. When I closed my VB program, Word would still be there. This seemed to me like interprocess communication of separate processes, but maybe I was fooled.

Anyway, does anyone have any suggestions? I know I can do this a variety of ways, but there has got to be a better way than using TCP (like SQL Server Enterprise Manager), DCOM, or a shared table.

Thanks!
Hubman
 
Old June 9th, 2004, 12:00 AM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default

After doing some more looking into Remoting, I am now thinking the way to interact with my Windows Service is through Remoting. However, this looks to be a fancy built in TCP listener, which I was wanting to avoid.

If I don't hear from anyone, I will probably purse implementing Remoting in my Windows Service.

Hubman





Similar Threads
Thread Thread Starter Forum Replies Last Post
Impersonate with windows service for Service A/C vinod_yadav1919 C# 0 October 18th, 2008 02:29 PM
Accessing Windows service from a windows app sajid08 C# 1 October 6th, 2006 10:25 AM
Windows Service r_ganesh76 General .NET 4 January 11th, 2005 05:08 PM
Windows 98 OCX control issues vs Windows XP benoyraj VB How-To 0 May 5th, 2004 08:10 AM
How to check if a windows program is running in c beardje2000 C++ Programming 0 December 17th, 2003 01:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.