Advertisement

MFC,SDI interaction problem

Started by September 10, 2004 08:13 PM
-1 comments, last by littlejedi 20 years, 2 months ago
if i created a DialogBar and have put a edit box in it. I wanna do this I put int a in the edit box Opengl Draw glBegin(GL_LINES) { vertex2f(0,0); vertex2f(0,a); } Then click "generate button" to draw it in the SDI How can I do it?Here's my code void CDlgBarView::OnButtonClick() { CMainFrame *p = (CMainFrame *)AfxGetApp()->m_pMainWnd; CString a; p->m_dlgbar.GetDlgItemText(IDC_EDIT,a); lev=atoi(a); CClientDC dc(this); BOOL bResult=wglMakeCurrent(dc.m_hDC, m_hrc); if (!bResult) return; glBegin(GL_LINES); { glVertex2f(0,0); glVertex2f(0,lev); } wglMakeCurrent(NULL,NULL); } But it didn't work, the window still remains what i tell it to draw when the windows creates(DrawScene) Hope you can help me!

This topic is closed to new replies.

Advertisement