Click here to Skip to main content
15,916,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can both VS2005 and 2008 be installed on XP Pin
Jaime Olivares25-Jul-11 16:37
Jaime Olivares25-Jul-11 16:37 
AnswerRe: Can both VS2005 and 2008 be installed on XP Pin
Ni740826-Jul-11 1:54
Ni740826-Jul-11 1:54 
AnswerRe: Can both VS2005 and 2008 be installed on XP Pin
Stefan_Lang27-Jul-11 3:42
Stefan_Lang27-Jul-11 3:42 
QuestionVisual C++ 2008 and Ultragrid 2.0 Pin
sujipal24-Jul-11 19:56
sujipal24-Jul-11 19:56 
AnswerRe: Visual C++ 2008 and Ultragrid 2.0 Pin
Code-o-mat24-Jul-11 22:07
Code-o-mat24-Jul-11 22:07 
AnswerRe: Visual C++ 2008 and Ultragrid 2.0 Pin
Maximilien25-Jul-11 3:27
Maximilien25-Jul-11 3:27 
QuestionHelp Regarding XML Parsing Pin
pix_programmer24-Jul-11 19:55
pix_programmer24-Jul-11 19:55 
AnswerRe: Help Regarding XML Parsing Pin
_AnsHUMAN_ 24-Jul-11 20:32
_AnsHUMAN_ 24-Jul-11 20:32 
GeneralRe: Help Regarding XML Parsing Pin
pix_programmer24-Jul-11 20:52
pix_programmer24-Jul-11 20:52 
GeneralRe: Help Regarding XML Parsing Pin
_AnsHUMAN_ 24-Jul-11 22:46
_AnsHUMAN_ 24-Jul-11 22:46 
QuestionHow to get unplug the Ethernet cable message in WSAAsyncSelect ? Pin
wangningyu24-Jul-11 16:00
wangningyu24-Jul-11 16:00 
AnswerRe: How to get unplug the Ethernet cable message in WSAAsyncSelect ? Pin
Richard MacCutchan24-Jul-11 21:11
mveRichard MacCutchan24-Jul-11 21:11 
GeneralRe: How to get unplug the Ethernet cable message in WSAAsyncSelect ? Pin
wangningyu24-Jul-11 21:21
wangningyu24-Jul-11 21:21 
GeneralRe: How to get unplug the Ethernet cable message in WSAAsyncSelect ? Pin
Richard MacCutchan24-Jul-11 23:12
mveRichard MacCutchan24-Jul-11 23:12 
GeneralRe: How to get unplug the Ethernet cable message in WSAAsyncSelect ? Pin
wangningyu24-Jul-11 23:13
wangningyu24-Jul-11 23:13 
QuestionVisual C++ Express receiving a custom message Pin
martinmos23-Jul-11 8:18
martinmos23-Jul-11 8:18 
I am totally new to C++, this is the first thing I've tried to do.
I have a simple program (A) which I want to receive a message from and send a message to another app (B).
I can send messages from A to B fine but if I do then A longer sees the message sent from B, although B gets 0 as the return from the message it sends to A.
I can receive a message (Message number AuMessage obtained using RegisterWindowMessageA) once from B but the message isn't received by A a second time if I send a message to B. If I never send a message to B I can keep receiving the messages in A.

Obviously I'm doingsomething wrong. Every reference seems to tell me to use something like this

BEGIN_MESSAGE_MAP(szWindowClass, CMyParentWndClass)
	//{{AFX_MSG_MAP(CWordPadApp)
	//AFX_MSG_MAP 
//	ON_MESSAGE(AuMessage,HandleAuCommand);
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


but I cannot see how to find CMyParentWndClass, so I have added code to WinProc like this

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

          //added this if clause
	if (message == AuMessage )
		{msgin = 7;some flag I intend to use
		 return 76;//any number for tests just so the sending app sees a reply
		}

	switch (message)
...


I couldn't add a new case because using a variable (AuMessage ) gives a compilation error.

How should I handle receiving and sending custom messages? Or can anyone supply a link where I can find the correct approach?
AnswerRe: Visual C++ Express receiving a custom message Pin
Albert Holguin23-Jul-11 8:58
professionalAlbert Holguin23-Jul-11 8:58 
GeneralRe: Visual C++ Express receiving a custom message [modified] Pin
martinmos23-Jul-11 9:12
martinmos23-Jul-11 9:12 
GeneralRe: Visual C++ Express receiving a custom message Pin
Albert Holguin23-Jul-11 19:37
professionalAlbert Holguin23-Jul-11 19:37 
GeneralRe: Visual C++ Express receiving a custom message Pin
martinmos23-Jul-11 22:53
martinmos23-Jul-11 22:53 
GeneralRe: Visual C++ Express receiving a custom message Pin
Albert Holguin25-Jul-11 4:07
professionalAlbert Holguin25-Jul-11 4:07 
GeneralRe: Visual C++ Express receiving a custom message Pin
martinmos25-Jul-11 11:12
martinmos25-Jul-11 11:12 
GeneralRe: Visual C++ Express receiving a custom message Pin
Albert Holguin25-Jul-11 12:30
professionalAlbert Holguin25-Jul-11 12:30 
AnswerRe: Visual C++ Express receiving a custom message Pin
Mark Salsbery23-Jul-11 12:29
Mark Salsbery23-Jul-11 12:29 
GeneralRe: Visual C++ Express receiving a custom message Pin
martinmos23-Jul-11 20:42
martinmos23-Jul-11 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.