Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++ v6-> 2k3 MFC Class Wizard woes 1

Status
Not open for further replies.

bennyboy2

Programmer
May 15, 2005
4
KR
With the V6 class wizard gone, I'm having trouble setting up even a simple event handler for an MFC dialog:

In "progDlg.cpp":
Code:
void CMouseandKeyboardDlg::OnMouseMove(UINT nFlags, CPoint point)
{
	if ((nFlags & MK_LBUTTON) == MK_LBUTTON)
	{
		CClientDC dc(this);
		dc.SetPixel(point.x, point.y, RGB(255, 255, 255));
	}
	CDialog::OnMouseMove(nFlags, point);
}

In "progDlg.h":
Code:
afx_msg void OnMouseMove(UINT nFlags, CPoint point);

Was the V6 Class Wizard doing more than this? The .net help library was characteristically unhelpful in explaining how to transition from V6.
 
yes, there are 3 places the VC6 wizard modifies.
It seems you have found 2 only

You should add a line under de BEGIN_MESSAGE_MAP too. Look for this in an existing program. This will associate the message with your handler function.

One more thing, VC++.net has another way of adding message handlers. I did not use it lately, but I remember that is something like an event tab under int the properties window and you add your handler there.



s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Doh!

Well, as usual, getting lost has helped me learn more than I would have by just using the old Class Wizard. I'm a little embarrassed that I didn't find the handlers in the properties window, but I've done mostly calculation-based stuff before without using any event handlers.

Anyway, thanks for the info. Things are up and running great. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top