Solved

Best way to make a single object instance public to other processes ?

Posted on 2016-09-16
7
38 Views
Last Modified: 2016-10-09
Hello Everyone,

I would like to ask you what is the best way to make a single object instance public to other processes ?  
As COM server exe is not directly foreseen is WCF still the right candidate ?

What do you think ?
Thank you very much in advance
Best regards.
MiQi.
0
Comment
Question by:festijazz
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 9

Expert Comment

by:Prakash Samariya
ID: 41801427
You might looking for Singleton Pattern which allow only one instance!
Please check below link
Implementing the Singleton Pattern in C#
0
 
LVL 1

Author Comment

by:festijazz
ID: 41801438
Hello Sir,
Thank you for your reply but I do not see how I will be able to inter link two process via the solution you propose.

A process needs to access an object defined and instantiated in another process.

What do you think ?
 Thank you very much in advance
 Best regards.
 MiQi.
0
 
LVL 9

Expert Comment

by:Prakash Samariya
ID: 41801682
Can you describe your need?
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 29

Expert Comment

by:pepr
ID: 41803049
Actually, a process is isolated from other processes by definition. The only way to share the information is through the data transfer.

In other words, the shared information is or a persistent data structure (information from the stared database, shared file, etc.), or the active object is encapsulated in the dedicated (another) process, and you use some communication protocol to ask for the info and get the information back.
0
 
LVL 33

Expert Comment

by:sarabande
ID: 41805227
you may use named shared memory for your purpose, if the object is a data structure. either process could map to the shared memory by name. the first process would copy the shared data to the memory (with or without parameters to control access or synchronisation). either process could have a pointer to the shared instance.

if the object also is code, you could manage it in a service and provide data + functions.

Sara
0
 
LVL 1

Accepted Solution

by:
festijazz earned 500 total points (awarded by participants)
ID: 41805522
Hello everyone,
thank you for all inputs but I have found the solution by googling on the web.
The solution I need to use is .NET remoting.
I can post you an example if needed.

Best regards.
MiQi
0
 
LVL 33

Expert Comment

by:sarabande
ID: 41835694
The Asker told us that they found a solution by using the .NET Framework.

I don't think that any of the other comments could be called a solution or assist.

Sara
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question