left of '->GetStatus' must point to class/struct/union/generic type
2012-04-28 11:47
561 查看
LRESULT CALLBACK PlayWindow::PlayWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)//这是一个static成员函数
{
switch (uMsg)
{
case WM_LBUTTONDOWN:
if(m_pIPlayCtrl->GetStatus() == 3)
{
m_pIPlayCtrl->Pause();
}
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
由于PlayWindowProc是窗口过程,在类中定义成static成员函数,m_pIPlayCtrl是非static变量,访问出现问题。
解决该问题:可以在static成员函数[b]PlayWindowProc变为非static成员函数,另外添加一个static成员函数__[b]PlayWindowProc,调用PlayWindowProc,这样[b]PlayWindowProc就可以访问非static成员了。如下所示:[/b][/b][/b]
LRESULT CALLBACK PlayWindow::__PlayWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PlayWindow* pThis = reinterpret_cast<PlayWindow*>(GetWindowLong(hWnd, GWL_USERDATA));
if(pThis)
{
return pThis->PlayWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
//视频播放窗口的过程函数////////////////////////////////////////////////////////////////////////
LRESULT CALLBACK PlayWindow::PlayWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_LBUTTONDOWN:
if(m_pIPlayCtrl->GetStatus() == 3)
{
m_pIPlayCtrl->Pause();
}
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
{
switch (uMsg)
{
case WM_LBUTTONDOWN:
if(m_pIPlayCtrl->GetStatus() == 3)
{
m_pIPlayCtrl->Pause();
}
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
由于PlayWindowProc是窗口过程,在类中定义成static成员函数,m_pIPlayCtrl是非static变量,访问出现问题。
解决该问题:可以在static成员函数[b]PlayWindowProc变为非static成员函数,另外添加一个static成员函数__[b]PlayWindowProc,调用PlayWindowProc,这样[b]PlayWindowProc就可以访问非static成员了。如下所示:[/b][/b][/b]
LRESULT CALLBACK PlayWindow::__PlayWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
PlayWindow* pThis = reinterpret_cast<PlayWindow*>(GetWindowLong(hWnd, GWL_USERDATA));
if(pThis)
{
return pThis->PlayWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
//视频播放窗口的过程函数////////////////////////////////////////////////////////////////////////
LRESULT CALLBACK PlayWindow::PlayWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_LBUTTONDOWN:
if(m_pIPlayCtrl->GetStatus() == 3)
{
m_pIPlayCtrl->Pause();
}
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
相关文章推荐
- error C2227: left of '->first' must point to class/struct/union
- VS2010:error C3083: 'Windows': the symbol to the left of a '::' must be a type
- VS2010:error C3083: 'Office': the symbol to the left of a '::' must be a type
- left of 'name' specifies undefined struct/union '$S1'
- c++ error: reference to 'plus' is ambiguous ; template<class _Tp> struct std::plus
- Must use 'struct' tag to refer to type 'tagCommonUserInfo'
- error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::
- Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass' ...
- Sending 'ccColor4B' (aka 'struct _ccColor4B') to parameter of incompatible type 'CIColor *'错误
- Unable to cast COM object of type 'System.__ComObject' to class type 的解决办法
- 去除Warning C4251 “class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class
- jsf配置问题 Error performing conversion of value ' of type class java.lang.String to type class
- illegal use of incomplete struct/union/class 'CAknViewAppUi'
- Unable to cast COM object of type 'Word.ApplicationClass' to interface type 'Word._Application'"
- Sending 'ccColor4B' (aka 'struct _ccColor4B') to parameter of incompatible type 'CIColor *'
- How to solve 'object of abstract class type "newFoo" is not allowed'?
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect
- spring mvc 数据绑定报错 Failed to convert property value of type 'java.lang.String' to required type 'int'
- Unable to load class 'org.codehaus.groovy.runtime.typehandling.ShortTypeHandling'
- 解决cast from 'char*' to 'char**' increases required alignment of target type [-Werror=cast-align]