Click here to Skip to main content
12,943,528 members (57,324 online)
Rate this:
Please Sign up or sign in to vote.
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 12-Feb-13 1:40am
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.
Albert Holguin 12-Feb-13 11:24am
I would recommend the dll method as well... +5
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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:[^][^]

I'm sure if you look into MFC extension dlls you'll find relevant information.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

Best Regards

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 4,643
CHill60 2,970
Maciej Los 2,348
Jochen Arndt 1,900
ppolymorphe 1,765

Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100