Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to communicate between two application,one is MFc another is WPF.

So far i have taken help from the following two links :


[^]

Interprocess Communication Between .NET and MFC Using WM_COPYDATA[^]

What I have tried:

So far i have managed to send message from wpf to mfc and get back the response.

But i couldn't manage to send messages from mfc to wpf yet.

For the wpf application,when i first send a msg to mfc,im storing the handle

int dotnetHandle = pCopyDataStruct->dwData;
HWND storedHandle = (int *)dotnetHandle;

And later sending the message :

::SendMessage(pFrame->storedHandle, WM_COPYDATA, 0, 0);

But wpf is not receiving any message.
Posted
Updated 29-Mar-17 10:17am

That's because the message loop in .NET is hidden from view. See Message Structure (System.Windows.Forms)[^] for a sample of how to catch messages.
 
Share this answer
 
Once I used interprocess communications between MFC and WPF using memory mapped files
Worked great with a big amount of data back and force.
Try that.There is a bunch of APIs for that
 
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