Hi all,
as a newbie of C#, I am rather surprised when I saw that the method of
System.ServiceP rocess.ServiceC ontroller - ExecuteCommand( int command) - has
only one parameter. What shall I do if I want to send other data contained in
a front-end GUI, say a windows form, to my windows service (could be on a
remote host)? Following is my code snipper,
-------------------------------------------------------------
In MyGui.cs:
private void buttonFind_Clic k(object sender, System.EventArg s e)
{
try
{
serviceControll er1.ExecuteComm and(129);
labelInfo.Text = "Execute command";
}
catch (System.Invalid OperationExcept ion exp)
{
MessageBox.Show (exp.ToString() );
}
}
--------------------------------------------------------------
In MyService.cs:
protected override void OnCustomCommand (int command)
{
switch (command)
{
case 129:
cmd129Handler() ;
break;
....
The function cmd129Handler() cannot retrieve parameters from MyGui.
Any ideas or suggestions? Thanks in advance! 3 10506
Hi,
Basicly what you need is IPC (Interprocess communication) ..
....to accomplish that you could use NamedPipes .. or Remoting .. or TCP/IP
protocol ...
I wroted library on that topic (IPC for .NET): http://www.habjansoftware.com/ipc_library.aspx
.... it contains IPCServer and IPCClient (and also PipeSender and
PipeReceiver) .. all based on NamedPipes ...
Regards,
Josip Habjan
URL: http://www.habjansoftware.com
"eedych" <ee****@discuss ions.microsoft. com> wrote in message
news:BE******** *************** ***********@mic rosoft.com... Hi all, as a newbie of C#, I am rather surprised when I saw that the method of System.ServiceP rocess.ServiceC ontroller - ExecuteCommand( int command) - has only one parameter. What shall I do if I want to send other data contained in a front-end GUI, say a windows form, to my windows service (could be on a remote host)? Following is my code snipper, ------------------------------------------------------------- In MyGui.cs: private void buttonFind_Clic k(object sender, System.EventArg s e) { try { serviceControll er1.ExecuteComm and(129); labelInfo.Text = "Execute command"; } catch (System.Invalid OperationExcept ion exp) { MessageBox.Show (exp.ToString() ); } } -------------------------------------------------------------- In MyService.cs: protected override void OnCustomCommand (int command) { switch (command) { case 129: cmd129Handler() ; break; ....
The function cmd129Handler() cannot retrieve parameters from MyGui. Any ideas or suggestions? Thanks in advance!
Hi Josip,
thanks for the concret answer. I visit your site and find that the
IPCServer/IPCClient solution is for two process on the local machine. I will
do some research about Remoting as you suggest. Thanks again!
eedych
"Josip Habjan" wrote: Hi,
Basicly what you need is IPC (Interprocess communication) .. ....to accomplish that you could use NamedPipes .. or Remoting .. or TCP/IP protocol ...
I wroted library on that topic (IPC for .NET): http://www.habjansoftware.com/ipc_library.aspx .... it contains IPCServer and IPCClient (and also PipeSender and PipeReceiver) .. all based on NamedPipes ...
Regards, Josip Habjan URL: http://www.habjansoftware.com "eedych" <ee****@discuss ions.microsoft. com> wrote in message news:BE******** *************** ***********@mic rosoft.com... Hi all, as a newbie of C#, I am rather surprised when I saw that the method of System.ServiceP rocess.ServiceC ontroller - ExecuteCommand( int command) - has only one parameter. What shall I do if I want to send other data contained in a front-end GUI, say a windows form, to my windows service (could be on a remote host)? Following is my code snipper, ------------------------------------------------------------- In MyGui.cs: private void buttonFind_Clic k(object sender, System.EventArg s e) { try { serviceControll er1.ExecuteComm and(129); labelInfo.Text = "Execute command"; } catch (System.Invalid OperationExcept ion exp) { MessageBox.Show (exp.ToString() ); } } -------------------------------------------------------------- In MyService.cs: protected override void OnCustomCommand (int command) { switch (command) { case 129: cmd129Handler() ; break; ....
The function cmd129Handler() cannot retrieve parameters from MyGui. Any ideas or suggestions? Thanks in advance!
Yes, it is for two or more processes only on local machine.
I'm glad i pointed you on right direction ..
Regards,
Josip Habjan
URL: http://www.habjansoftware.com
"eedych" <ee****@discuss ions.microsoft. com> wrote in message
news:D4******** *************** ***********@mic rosoft.com... Hi Josip, thanks for the concret answer. I visit your site and find that the IPCServer/IPCClient solution is for two process on the local machine. I will do some research about Remoting as you suggest. Thanks again!
eedych
"Josip Habjan" wrote:
Hi,
Basicly what you need is IPC (Interprocess communication) .. ....to accomplish that you could use NamedPipes .. or Remoting .. or TCP/IP protocol ...
I wroted library on that topic (IPC for .NET): http://www.habjansoftware.com/ipc_library.aspx .... it contains IPCServer and IPCClient (and also PipeSender and PipeReceiver) .. all based on NamedPipes ...
Regards, Josip Habjan URL: http://www.habjansoftware.com "eedych" <ee****@discuss ions.microsoft. com> wrote in message news:BE******** *************** ***********@mic rosoft.com... > Hi all, > as a newbie of C#, I am rather surprised when I saw that the method of > System.ServiceP rocess.ServiceC ontroller - ExecuteCommand( int command) - > has > only one parameter. What shall I do if I want to send other data > contained > in > a front-end GUI, say a windows form, to my windows service (could be on > a > remote host)? Following is my code snipper, > ------------------------------------------------------------- > In MyGui.cs: > private void buttonFind_Clic k(object sender, System.EventArg s e) > { > try > { > serviceControll er1.ExecuteComm and(129); > labelInfo.Text = "Execute command"; > } > catch (System.Invalid OperationExcept ion exp) > { > MessageBox.Show (exp.ToString() ); > } > } > -------------------------------------------------------------- > In MyService.cs: > protected override void OnCustomCommand (int command) > { > switch (command) > { > case 129: > cmd129Handler() ; > break; > .... > > The function cmd129Handler() cannot retrieve parameters from MyGui. > Any ideas or suggestions? Thanks in advance! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Yarik |
last post by:
Hello there!
I am working with MS SQL Server 2000.
I have a table function that takes an integer parameter and returns a
table, and I can successfully use it like this (passing a literal
as a parameter):
SELECT * FROM MyTableFunction(1)
|
by: wilson |
last post by:
Dear all,
In this time, I want to pass array to function.
What should I declare the parameter in the function?i
int array or int array? Which one is correct?
/********************************************************
Below is my code:
********************************************************/
|
by: Dion Heskett |
last post by:
How can I pass a Class as a parameter to in a method ?
i.e.
Private myMethod( string pram1, Classobject as pram2)
{
Classobject.DataSource = reader;
Classobject.DataBind();
}
|
by: Jay Douglas |
last post by:
Hello, I am needing to pass a class object (this) by reference to a method
in a different class. When I do the following code I get the error (Cannot
pass '<this>' as a ref or out argument because it is read-only) .. Is there
any way to make <this> not read-only?
I have simplified the following code. There is a Task class and a Data...
|
by: |
last post by:
Hi,
I've defined an ObjectDataSource and a parameterized DataSet. I would like
it if I could pass the parameter value that describes the query that creates
the DataSet as part of a user control declaration. Here's how the parameter
is described in the context of my ObjectDataSource:
<asp:ObjectDataSource ID="ObjectDataSource1"...
| |
by: Brett |
last post by:
I have several classes that create arrays of data and have certain
properties. Call them A thru D classes, which means there are four. I can
call certain methods in each class and get back an array of data. All four
classes are the same except for the number of elements in their arrays and
the data.
I have a MainClass (the form), which...
|
by: Derek Basch |
last post by:
This one has always bugged me. Is it better to just slap a "self" in
front of any variable that will be used by more than one class method
or should I pass around variable between the methods?
Flamewar........NOW!
jk, I really do want other opinions.
Thanks,
Derek
|
by: _Mario.lat |
last post by:
Hallo,
I have a little question:
In the function session_set_save_handler I can pass the name of function
which deal with session.
In Xoops code I see the use of this function like that:
session_set_save_handler(array(&$sess_handler, 'open'),
array(&$sess_handler, 'close'), array(&$sess_handler, 'read'),
array(&$sess_handler, 'write'),...
|
by: khalid sohail |
last post by:
hi everybody
i want to pass the window size parameter to <asp:hyperlink> attribute Navige URL Property. tell me how to pass the parameter to it.....actually i want to open the new window on the basis to the user click the data in the column i m passing the Query String also to opening page......i have done that work through the datagrid...
|
by: =?Utf-8?B?U3dhcHB5?= |
last post by:
Can anyone suggest me to pass more parameters other than two parameter for
events like the following?
Event:
Onbutton_click(object sender, EventArgs e)"
Event handler:
button.Click += new EventHandler(Onbutton_click);
I want to pass more information related that event. & want to use that
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |