Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
hello,
I had made a console application in VC++ Win32 Console which generates different kind of data and now I need to sync the data with another MFC application. But I dont know how to get started. Any suggestion guys on this?



thanks in advance.
Posted
Updated 27-Jul-12 2:45am
v2
Comments
enhzflep 27-Jul-12 3:06am    
Are you able to expand on this a little?
Why not just write to a file from the console-app?
Or how about using sockets to communicate between the two?

What is it you're trying to accomplish?
(damn, that was a lot of questions :blush:)
Sergey Alexandrovich Kryukov 27-Jul-12 3:37am    
Generally, not a good idea. Why would you make your life harder? It is possible, but first explain your ultimate purpose. You cannot hope for help too much if experts can suspect the whole idea is wrong...
--SA
meshinator 27-Jul-12 3:44am    
well,guys thank you for your reply,actually m sorry i am bound not to share the code,since i work in a company as a fresher,but lemme explain you with example: suppose my console application gives names of different people (john,harry,philip etc)(i have extracted these names from different system using its API) and now there is another application which is in MFC ,now i need to select any name(John,harry,Philip etc) and send to the MFC application in the name section and also when there is other name in the MFC application(which can be from other source) than the name should get updated in the console application too.
pasztorpisti 27-Jul-12 4:08am    
First consider building in to two programs into one MFC application. If this is not possible then you have a lot of options to communicate between the two programs from the most simple (text) to the most advanced ways (shared memory). If you keep those programs separated then you will have to use some kind of IPC between the two programs - pipe, loopback socket, or shared memory. If the two processes are always on the same machine then its an easy way to use pipes. Loopback sockets are much similar to pipes, both of these are streams, maybe a Loopback socket is less problematic. You can create a Stream class and hide the actual implementation inside so you can replace it later without heavy efforts. IPC article on codeproject: http://www.codeproject.com/Articles/34073/Inter-Process-Communication-IPC-Introduction-and-S
Hawkfuture 27-Jul-12 4:19am    
pls try shared-memory and event, google for detail.

1 solution

 
Share this answer
 
Comments
meshinator 30-Jul-12 1:25am    
Thanks Volynsky.
meshinator 30-Jul-12 2:15am    
Volynsky ,the links you gave was ok,but in my condition the MFC application where i want to send the data from my C++ console application,i dont hab source code of that MFC application..its data's are stored in sql database..and i hab access to that database so Volynsky can u further suggest me how to move ahead in this?
Volynsky Alex 30-Jul-12 15:46pm    
Ok. What can you say about this: http://stackoverflow.com/questions/3235905/sending-string-from-console-application-to-mfc

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