为什么我切分完窗口之后 pDC->TextOut就不能显示字符串了啊? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void CCarViewView::OnDraw(CDC* pDC){ CCarViewDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDC->TextOut(20,20,"fdsfds"); // TODO: add draw code for native data here}BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: Add your specialized code here and/or call the base class if (!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } return TRUE;} 刚才试了一个,可以显示的,我觉得原因可能是,因为有两个CView类(左右窗口各一),你的OnDraw()函数是在其中一个定义的,另一个没有定义。 BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: Add your specialized code here and/or call the base class if (!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } m_wndSplitter.GetPane(0,0)->SetWindowText(TEXT("..."))//用这个代码显示文字 return TRUE;} VS2008中使用mediaplayer 控件出错 看别人的程序,如果在ClassWizzard中根据ID号找到响应函数 使用BCG的问题 关于一个简单的聊天程序的问题 为什么进行程序Release的时候。Cdialog.Domodol()函数返回值为-1???? 图像的镂空显示 如何在运行时,设置一个对话框内部各控件的Tab Order啊?有这样的API么? CSocket::Create 在NT服务中该怎么调用 怎么手动添加MSCOMM控件,需要注意些什么? 中国有没有针对个人的职业发展做咨询的? 菜鸟提问:com中包容,聚合 和继承之间的联系和区别 怎么实现互斥机制?
{
CCarViewDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->TextOut(20,20,"fdsfds");
// TODO: add draw code for native data here
}BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
} return TRUE;}
{
// TODO: Add your specialized code here and/or call the base class
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
m_wndSplitter.GetPane(0,0)->SetWindowText(TEXT("..."))//用这个代码显示文字
return TRUE;
}