Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of process

Status
Not open for further replies.

millzy7

Programmer
Dec 9, 2003
96
US
Hi,

I need to make my C# .exe run out of process.

I am using Excel to test. At the moment, if i open two spreadsheets and run the code, they create two different instances of the object. I want the first one to create the object and the second one to be able to see the changes made by the first.

Is there something in the registry i must change or is it something in the build? Thanks

'VBA code
Dim loader As ExtremeLoadBalancer.COMInterface
Set loader = New ExtremeLoadBalancer.COMInterface

Dim objcont As ExtremeLoadBalancer.Controller
Set objcont = loader.controllerObj




 
You're getting two instances of Excel because your two executables are out of process to each other.

.exe == new process
.dll == shared with owning process

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Yes, but i want them to acccess the same instance of the .exe so they share the data held in it.
 
You can't share variables across process space. If you start with two exe's, they will always be addressing two instances of Excel.

ProgramOne.exe ---- > ExcelInstance1

AnotherCopyOfProgramOne.exe -----> ExcelInstance2

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Apologies, i seem to have confused the issue.

I want 2 instances of excel to call methods in my C# .exe

And i dont want either excel process to "own" the .exe

So when one excel instance changes a variable in my c# application, the other excel instance can see the changes.
 
Same problem - - just reverse the arrows.

However, since you have control over the exe's (can change the source code), you can use one of the many inter-process communication mechanisms available to you to share info between them. Choose from:
- sockets
- xml-rpc
- .net remoting
- web services
- message queuing
- and more

Chip H.



____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks Chip,

I guess you dont recommend DCOM so!

I've wasted so much time on this now, i might just use sockets. Getting to the moon seems easier than gettin a C++ client to talk to a C# server through DCOM!!!
 
Think I know what you want to do. Have you tried to simply make your values static?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top