Link to home
Start Free TrialLog in
Avatar of mileta
mileta

asked on

Send/Receive message

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.
ASKER CERTIFIED SOLUTION
Avatar of galkin
galkin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mileta
mileta

ASKER

ThanX