Static_cast compiler error in C ++ sdi application

I have a small SDI application to which I am trying to add menu usage tracking, i.e. how many times certain menu items are selected by the user.

Some menu items are processed by the View component (DemoView.cpp) and others using the main application (DemoApp.cpp). Since the tracking structure is defined in the main application, I believe that I should notify the view parent with a special message when a menu item (processed by View) is selected.

If this is correct, my problem is that I cannot create the correct ON_MESSAGE command. It looks like this:

 ON_MESSAGE(WM_INCREASE_FREQ, &CDemoApp::OnIncreaseFreq)

where OnIncreaseFreq () is defined as follows:

LRESULT CDemoApp::OnIncreaseFreq(WPARAM, LPARAM)

However, I get this error:

error C2440: 'static_cast' : cannot convert from 
'LRESULT (__thiscall CDemoApp::* )(WPARAM,LPARAM)' to 
'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'

I would appreciate any help with this.

+3
2

- , CWnd. CDemoApp CWnd, .

+3

, . reinterpret_cast < > .

0

Source: https://habr.com/ru/post/1775166/


All Articles