Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Visual C++ Express receiving a custom message Pin
Mark Salsbery23-Jul-11 21:07
Mark Salsbery23-Jul-11 21:07 
GeneralRe: Visual C++ Express receiving a custom message Pin
martinmos24-Jul-11 1:08
martinmos24-Jul-11 1:08 
GeneralRe: Visual C++ Express receiving a custom message Pin
Richard MacCutchan24-Jul-11 1:25
mveRichard MacCutchan24-Jul-11 1:25 
GeneralRe: Visual C++ Express receiving a custom message Pin
martinmos24-Jul-11 5:37
martinmos24-Jul-11 5:37 
QuestionC program to start before windows boot Pin
ayandelhi23-Jul-11 4:31
ayandelhi23-Jul-11 4:31 
AnswerRe: C program to start before windows boot Pin
Richard MacCutchan23-Jul-11 6:22
mveRichard MacCutchan23-Jul-11 6:22 
AnswerRe: C program to start before windows boot Pin
Rajesh R Subramanian23-Jul-11 6:56
professionalRajesh R Subramanian23-Jul-11 6:56 
GeneralRe: C program to start before windows boot Pin
Albert Holguin23-Jul-11 8:07
professionalAlbert Holguin23-Jul-11 8:07 

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.