首页
网站首页
公司简介
资讯中心
推荐内容
返回顶部
如何打造对话框,成功返回的文件句柄www.64222.com
发布时间:2019-12-25 16:24
浏览次数:

//MFCView.cpp:Definestheentrypointfortheapplication.//#include"stdafx.h"#include"resource.h"classCMyView:publicCView{DECLARE_MESSAGE_MAP()public:virtualvoidOnDraw(CDC*pDC);afx_msgvoidOnPaint();afx_msgvoidOnNew();};BEGIN_MESSAGE_MAP(CMyView,CView)ON_COMMAND(ID_NEW,OnNew)//ON_WM_PAINT()END_MESSAGE_MAP()voidCMyView::OnNew(){AfxMessageBox("新建被点击");}voidCMyView::OnPaint(){PAINTSTRUCTps={0};HDChdc=::BeginPaint(this-m_hWnd,ps);::TextOut(hdc,200,200,"CMyView::OnPaint",strlen("CMyView::OnPaint"));::EndPaint(this-m_hWnd,ps);}voidCMyView::OnDraw(CDC*pDC){pDC-TextOut(100,100,"CMyView::OnDraw");}classCMyFrameWnd:publicCFrameWnd{DECLARE_MESSAGE_MAP()public:CSplitterWndsplit1;CSplitterWndsplit2;public:virtualBOOLOnCreateClient(LPCREATESTRUCTlpCreateStruct,CCreateContext*CContext);afx_msgvoidOnPaint();afx_msgintOnCreate(LPCREATESTRUCTlpCreateStruct);};BEGIN_MESSAGE_MAP(CMyFrameWnd,CFrameWnd)ON_WM_PAINT()ON_WM_如何打造对话框,成功返回的文件句柄www.64222.com。CREATE()END_MESSAGE_MAP()BOOLCMyFrameWnd::OnCreateClient(LPCREATESTRUCTlpCreateStruct,CCreateContext*CContext){split1.CreateStatic(this,1,2);//这句代码出错returnCFrameWnd::OnCreateClient(lpCreateStruct,CContext);}intCMyFrameWnd::OnCreate(LPCREATESTRUCTlpCreateStruct){CMyView*pView=newCMyView;pView-Create(NULL,"",WS_CHILD|WS_VISIBLE|WS_BORDER,CRect(0,0,200,200),this,AFX_IDW_PANE_FIRST,NULL);m_pViewActive=pView;returnCFrameWnd::OnCreate(lpCreateStruct);}voidCMyFrameWnd::OnPaint(){PAINTSTRUCTps={0};HDChdc=::BeginPaint(m_hWnd,ps);::TextOut(hdc,200,200,"我是框架客户区",strlen("我是框架客户区"));::EndPaint(m_hWnd,ps);}classCMyWinApp:publicCWinApp{public:virtualBOOLInitInstance();};CMyWinApptheApp;BOOLCMyWinApp::InitInstance(){CMyFrameWnd*pFrame=newCMyFrameWnd;pFrame-Create(NULL,"MFCView",WS_OVERLAPPEDWINDOW,CFrameWnd::rectDefault,NULL,MAKEINTRESOURCE(IDR_MENU1));m_pMainWnd=pFrame;pFrame-ShowWindow(SW_SHOW);pFrame-UpdateWindow();returnTRUE;}代码已经写好的,调试起来运行错误DebugAssertionFailed!Program:..avc++6.0_win8MyProjectsMFCDay05MFCViewDebugMFCView.exeFile:winsplit.cppLine:364Forinformationonhowyoureprogramcancauseanassertionfailure,seetheVisualC++documentationonasserts.(PressRetrytodebugtheapplication)-------------------------------------------------------------------------------------------DebugAssertionFailed!Program:..avc++6.0_win8MyProjectsMFCDay05MFCViewDebugMFCView.exeFile:winsplit.cppLine:1315Forinformationonhowyoureprogramcancauseanassertionfailure,seetheVisualC++documentationonasserts.(PressRetrytodebugtheapplication)---------------------------------------------------------------------------------------------我在winsplit.cpp中查到错误的两处代码是:CWnd*pView=GetDlgItem(IdFromRowCol(row,col));ASSERT(pView!=NULL);//panescanbeaCWnd,butareusuallyCViewsreturnpView;------------------------------------------------------------------------ASSERT(pWnd!=NULL);ASSERT(pWnd-m_hWnd!=NULL);如果把CMyFrameWnd::OnCreateClient函数中的split1.CreateStatic(this,1,2);注释掉则程序没有报错,请问到底是哪里的问题呢,,为什么窗口切分始终用不了?

window编程调用apimfc或者要其它打造好的库,问题来了一个简单的对话框用C标准库函数如何自制,要用什么知识.个人是这样想的大概通过绘画出对话框模型然后编辑有实用功能可视化对话框,我想知道详细运用了什么知识什么算法?

for(k=0;klen;k++)//将数组转换为Cstring型变量{BYTEbt=*(char*)(rxdata+k);//字符型if(m_ctrlHexDiaplay.GetCheck())strtemp.Format("%02X",bt);//将字符以十六进制方式送入临时变量strtemp存放,注意这里加入一个空隔elsestrtemp.Format("%c",bt);//将字符送入临时变量strtemp存放m_EditReceive+=strtemp;//加入接收编辑框对应字符串}其中strtemp.Format("%02X",bt);和strtemp.Format("%c",bt);不对,求大神解答,急啊

www.64222.com 1

友情链接: 网站地图
Copyright © 2015-2019 http://www.nflfreepicks.net. 新葡萄京娱乐场网址有限公司 版权所有