473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Calling a method on a different process

Hello all,

I am looking to call a method on a process - in fact another instance of the
same application - once I have already determined it is running. Do I need
to use remoting to achieve this or is there a simpler mechanism since it is
on the same machine?

Thanks in advance for any suggestions,
Mike
Nov 15 '05 #1
3 4132
I think the best way is to use remoting, but there are other options like
MSMQ I believe to communicate between AppDomains...

Greetz,
-- Rob.

Mike Smith wrote:
Hello all,

I am looking to call a method on a process - in fact another instance
of the same application - once I have already determined it is
running. Do I need to use remoting to achieve this or is there a
simpler mechanism since it is on the same machine?

Thanks in advance for any suggestions,
Mike

Nov 15 '05 #2
Would I be right in thinking though that this would invoke the method in the
caller's process rather than in the called process? In my case I definitely
need to affect the actions of the found process rather than simply use the
method.

Hope this makes sense,

Mike

"mk" <mk@nospam.com> wrote in message
news:00****************************@phx.gbl...
If you have a reference to the assembly, you can
instantiate the class you need and call the method you
need. Given that it is another instance, you have all
the class structures available to you. For example (a is
the other process assembly):
object o = a.CreateInstance("YourAppName.CTargetClass");
CTargetClass ct = (CTargetClass)o;
ct.TargetMethod();

HTH,

MK
-----Original Message-----
Hello all,

I am looking to call a method on a process - in fact

another instance of the
same application - once I have already determined it is

running. Do I need
to use remoting to achieve this or is there a simpler

mechanism since it is
on the same machine?

Thanks in advance for any suggestions,
Mike
.

Nov 15 '05 #3
mk
Check out .Net Remoting, Server Activated Objects, you'll
be on the same machine so use BinaryFormatting and TCP
channels.

HTH,

mk
-----Original Message-----
Would I be right in thinking though that this would invoke the method in thecaller's process rather than in the called process? In my case I definitelyneed to affect the actions of the found process rather than simply use themethod.

Hope this makes sense,

Mike

"mk" <mk@nospam.com> wrote in message
news:00****************************@phx.gbl...
If you have a reference to the assembly, you can
instantiate the class you need and call the method you
need. Given that it is another instance, you have all
the class structures available to you. For example (a is the other process assembly):
object o = a.CreateInstance ("YourAppName.CTargetClass"); CTargetClass ct = (CTargetClass)o;
ct.TargetMethod();

HTH,

MK
>-----Original Message-----
>Hello all,
>
>I am looking to call a method on a process - in fact

another instance of the
>same application - once I have already determined it
is running. Do I need
>to use remoting to achieve this or is there a simpler

mechanism since it is
>on the same machine?
>
>Thanks in advance for any suggestions,
>Mike
>
>
>.
>

.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: belgiozen | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
7
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is...
2
by: Daniel Lidström | last post by:
I'm using a library called fyba. This library reads and writes files in a format called sosi. fyba uses the following code to determine if the calling process has own methods to handle errors,...
0
by: Gilad | last post by:
Hello. I'm currently implementing a WCF service. The service is based on a simple winservice with multiple objects hosting multiple services on the same port (different URLs). all the services...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.