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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ON_MESSAGE Error?

Status
Not open for further replies.

panioti

Programmer
Jan 5, 2005
15
US
I have just migrated from version 5 to .net 2003.
I get some warnings, pointing out my sloppy coding technique; but also one error on the ON_MESSAGE message map entry. I reviewed the .net documentation and found no changes in the format. I can't figure out what's wrong.
It works for version 5.

#define MYMSG (WM_APP + 1)

//sending the msg
pDestWnd->SendMessage(MYMSG,0,0);

//receiving it--the message map entry
... //class wizard generated msgs
//}}AFX_MSG_MAP //end of class wizard entries
ON_MESSAGE (MYMSG, OnUpdatePage)
END_MESSAGE_MAP()

//process it
CMyView::OnUpdatePage()
{
//bunch of stuff
}




 
What's the error, pray tell?

[sub]I REALLY hope that helps.[/sub]
Will
 
I knew I forgot something.
The error is C2440--static_cast, I don't understand the description of this error.
...
The errors occur because the function pointers, which expect to return a type using the C calling convention, are assigned to functions that expect to return a type using the C++ calling convention.

To resolve C2440 because of incompatible calling conventions, declare functions that return a UDT after the UDT definition.
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top