Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need a functionality to be used by two MFC Applications.

This functionality requires a GUI Window that manipulates user events and data at the background

Using a Dll to implement the functionality will not help since the functionality requires GUI and hence windows and resource files need to be created.

If I implement the functionality using an exe and call the exe in two applications, then I also need data to send to and fro the two applications (which are exes) at runtime.

Kindly help me and suggest me some detailed ideas and references how to achieve my requirement
Posted
Comments
Matthew Faithfull 12-Feb-13 7:43am    
Why is using a DLL giving you problems? It is the right way to share functionality between applications. I would focus on what's preventing you from getting that solution to work.
nv3 12-Feb-13 8:15am    
Why do you think that when your functionality has also GUI components that precludes the use of a DLL? You can have resources in a DLL as well. In fact, some people use DLLs just to distribute various resources.

I don't get what's the incompatibility between DLLs and windows. Who told you you cannot have windows created from DLLs?

You should create an MFC extension DLL and put your functionality there, exporting what needs to be used from the client applications.

Of course, you always have alternatives. For instance you can create an out-of-proc COM server that implements that functionality and communication between the processes (your app and the COM server) done through COM. However, I really see no point in going for something like this.
 
Share this answer
 
Comments
Albert Holguin 12-Feb-13 11:24am    
I would recommend the dll method as well... +5
I place GUIs in dlls all the time... you just have to set the resources handle correctly when you create the windows within the dll and everything else pretty much works the same.

Here's some info:
http://stackoverflow.com/questions/3577818/mfc-app-loading-dialog-from-another-dll[^]
http://www.ucancode.net/Visual_C_MFC_Samples/Export-dialog-to-mfc-extension-dll.htm[^]

I'm sure if you look into MFC extension dlls you'll find relevant information.
 
Share this answer
 
Hi,

Can you try with SendMessage /PostMessage. You can also create a NamePipe for this communication.

Best Regards
Muthuraja
 
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