|
-
June 2nd, 2002, 07:19 PM
#1
Afx_pmsg???!!!
I'm declaring:
afx_msg LRESULT OnSetModifiedFlag(WPARAM wParam, LPARAM lParam);
and putting this next line into my message map:
ON_COMMAND(SET_MODIFIED_FLAG, OnSetModifiedFlag)
and I am getting this compile error. This used to compile before I switched to VC++ .NET. =(
error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CMyCtrl::* )(WPARAM,LPARAM)' to 'AFX_PMSG'
Any ideas?
-
October 17th, 2003, 09:25 AM
#2
I have the same problem. Did you find a solution?
file.h
afx_msg int OnFileSaveAs();
file.c
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
int App::OnFileSaveAs()
I get the same error, but it compiles fine with 6.0.
-
October 17th, 2003, 10:55 AM
#3
The definition of ON_COMMAND (and other macros) changed between 6.0 and 7.0, from using explicit casting to static_cast. ON_COMMAND takes a AfxSig_vpv function [ void (void*) ], not a AfxSig_lwl [ LRESULT (WPARAM, LPARAM) ].
Change the return type and remove the WPARAM and LPARAM from the declaration and definition of your function.
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|