Solved

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

Posted on 2016-09-16
7
28 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 8

Expert Comment

by:Prakash Samariya
Comment Utility
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
Comment Utility
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 8

Expert Comment

by:Prakash Samariya
Comment Utility
Can you describe your need?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 28

Expert Comment

by:pepr
Comment Utility
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 32

Expert Comment

by:sarabande
Comment Utility
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)
Comment Utility
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 32

Expert Comment

by:sarabande
Comment Utility
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQl help with selection 14 44
How to change a specific bit from a file 2 19
String manipulation 15 49
Achieve json result 2 28
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now