不一定非得要Subclass在这种类似的地方处理
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_CREATE:
AfxMessageBox("Create");
break;
default:
break;
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_CREATE:
AfxMessageBox("Create");
break;
default:
break;
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
解决方案 »
- 求助:Telnet服务端程序
- 一个指针传递的问题
- 高手请进,关于VB中构造struct中的union,谢谢
- 封装OCX为dll失败
- VC中如何实现让用户自定义打印模板,并完成打印?
- 请问在一个程序里调用数据库的数据,这数据有几种存储格式?
- CFindReplaceDialog与CRichEditCtrl配合使用过程中,如何更改搜索方向(UP、DOWN)?
- 如何在vc中得到win2k登录的用户名?
- 谁有从ASF转换到RM格式的工具
- 高分(300分)求购 G.729 语音压缩的源程序或相关资源
- 请问如何全屏显示我开发的小程序窗口(VC++6.0)
- 请问mfc中在一个对话框中接受键盘响应的函数是什么?
有这样的错误:
error C2440: 'type cast' : cannot convert from '' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
None of the functions with this name in scope match the target type
{
WNDCLASS wc;
if(!GetClassInfo(NULL,"MDICLIENT",&wc))
return FALSE;
wc.style|=CS_DBLCLKS;
wc.lpszClassName="DBLCLKMDIClient";
//wc.lpfnWndProc=(WNDPROC)WindowProc;
return RegisterClass(&wc);
}
LRESULT CMDIClass::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
switch(message)
{
case WM_CREATE:
AfxMessageBox("Create");
return TRUE;
break;
default:
return CWnd::WindowProc(message, wParam, lParam);
break;
}
}
子类化MDICLient窗口,想获取它创建期间的消息。
CMyListView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszName = WC_LISTVIEW;
cs.style &= ~LVS_TYPEMASK;
cs.style |= LVS_REPORT; return CListView::PreCreateWindow(cs);
}