Click here to Skip to main content
15,868,049 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ALL,
I found way to communicate two exe in mfc by using CSocket class.
A Article
A-Universal-TCP-Socket-Class-for-Non-blocking-Serv[^]
helps me lot but this article only used to passed normal char*.
Now i want pass Whole CObarray or CObject to communicate two exe.
Posted

1 solution

The article decribes also how to send binary data. The usual way is to define your own protocol using one or more structures containing length and data members. Such structures may contain the data members of a CObject class. On the receiving side, a new object can then be created using the received data.

But transferring dynamic objects is very difficult because they usually contain other dynamic objects which can't be just copied this way.

Depending on your requirements, I suggest to define a protocol with data structures, or use other methods for interprocess communication.
 
Share this answer
 
Comments
Coder Block 22-Feb-12 2:54am    
I Have tried it with structure but I try with Cobarray it recieve same count of obarray but it cant't return me actual value.
Jochen Arndt 22-Feb-12 3:08am    
How did you tried it? May be you should update your question showing us your code.
A CObArray stores its items in dynamically allocated memory. You can't pass such an array as it is. You must iterate through the elements, get the content, and copy that to your transmit structure. But each CObject element is also a dynamic object that can't be copied as it is.

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