Solved

Send/Receive message

Posted on 1997-11-24
2
631 Views
Last Modified: 2013-11-20
Hi all,
Does anybody know why one application don't receive to message sent from  another application.

In first application I have:

const UINT nMsgID = RegisterWindowMessage( "MESSAGE" );
and
void CSendMessageView::OnButtonSend()
{
  ::SendMessage( HWND_BROADCAST, nMsgID, 0, 0 );
}


and in second:

const UINT  wm_Raport = RegisterWindowMessage( "MESSAGE" );
BEGIN_MESSAGE_MAP(CReceiveMsgView, CView)
  //{{AFX_MSG_MAP(CReceiveMsgView)
  // NOTE - the ClassWizard will add and remove mapping macros here.
  //    DO NOT EDIT what you see in these blocks of generated code!
  //}}AFX_MSG_MAP
  // Standard printing commands
  ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  ON_REGISTERED_MESSAGE(wm_Raport, RaportMsg)
END_MESSAGE_MAP()
and
void CReceiveMsgView::RaportMsg()
{
  MessageBox( "RECEIVE" );
}

But when I click on button for sending message in first application second application is quiet (dont have any raport).

Please help me!

Mileta.
0
Comment
Question by:mileta
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 10 total points
ID: 1310681
You must place message handler in your parent frame class, not in view since registered message is sent to main application window and as this is registered message it is not routed standard through MFC message map mechanism and doesn't reach view class.
0
 

Author Comment

by:mileta
ID: 1310682
ThanX
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 55
deburging in oracle form 12 87
ffmpeg - "rtsp://...... Operation not permitted" 4 73
has22 challenge 11 78
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now