Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to build project and can pass and object(EX: TextBox...) between two or more exe but I don't know what should I do it. so please have a kindness to help send an example project.... Thank in advance...
Posted
Comments
Timberbird 25-Nov-11 10:42am    
But why would you pass a TextBox between processes (which I believe is what you intend to do)? Just to read its text? Then it's the text you should pass, not the control (actually, control copy or possibly handle) itself
Sergey Alexandrovich Kryukov 25-Nov-11 18:19pm    
I've added my solution where I tried to explain the general view of the problem and credited your post. Please see.

Unfortunately, OP looks too confused to feel right approaches to development; I would recommend to get more experience participating in real-life projects.
--SA
Sergey Alexandrovich Kryukov 25-Nov-11 17:40pm    
Why to do such weird thing, ever?
--SA

Hi,


This is called Serialization. Look at the article below to have more informations :
it convert an object to a file, then the second process could read this file deserialize.
You can even send this file through the network by a socket and deserialize it on the other side of the wire :).

Object Serialization using C#[^]




Best regards.
EL GAABEB.
 
Share this answer
 
v2
Comments
kornkimhour 25-Nov-11 11:13am    
I wanna pass class object across exe...it means I have two exe winform then I wanna pass class object in exe1 to exe2 in a local computer...what is the solution...? could you give me the example Project? thx for ur attention
elgaabeb 25-Nov-11 11:21am    
This is done by a serialization technique, you save an object into a file on the disk. Then you can do what you want by this file, read it by another process and decrypt its content to transform it into the object (deserialization) or even send it to another host through a socket and deserialize it.
elgaabeb 25-Nov-11 11:18am    
Give a look at the article that I posted, it contains explained technique and a sample project to do this.
kornkimhour 25-Nov-11 11:34am    
But if I have many exe to access this file It can be slow down or not ? I am very worry about it.. Example connection string object I want all exe use only one connection so if I do like that may be the computer will slow down.....
LanFanNinja 25-Nov-11 12:28pm    
+5
Two different EXEs mean two different processes, and the process memory space are perfectly isolated. Therefore, an attempt to share any components like controls is counter-productive. The exchange, when needed, should be performed at the level of semantic data. Look at the comment to the question by Timberbird, about passing just the value of the Text property — this is a healthy approach. In a more general view, you need to develop a data model in a separate data layer and pass only the data instances.

Generally, integration between processes in not fruitful, to tell the least. Integration should be done at the level of component assemblies (class library) referenced by an entry assembly into a single process.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900