본문 바로가기
반응형

IT창고308

MFC 클래스에서 포인터 얻기 1. App 클래스의 포인터를 얻을 때 // 어디서든 연결가능 (view doc frm...) AfxGetApp(); // CChoonApp *pApp = (CChoonApp *)AfxGetApp() // 클래스명 Choon 2. 메인 프레임 클래스의 포인터를 얻을 때 (app와 같이 어디서든..) AfxGetMainWnd(); // CMainFrame *pFrm = AfxGetApp()->m_pMainWnd; // (CMainFrame *)AfxGetMainWnd() // CMainFrame *pFrm = (CMainFram *)AfxGetMainWnd(); 3 메인프레임에서 뷰 얻을 때 (Frm -> view) GetActiveView // CChoonView *pView = pFrm->GetActi.. 2008. 3. 5.
vs2005 에서 cmd.exe 에러 window\system32\cmd.exe 를 vc\ 에다 복사 해주면 해결..!@!@@ 2008. 2. 20.
4분할 윈도우 코드 /*m_wndSplitter1.CreateStatic(this, 1, 2); m_wndSplitter2.CreateStatic(&m_wndSplitter1, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter1.IdFromRowCol(0, 0)); m_wndSplitter2.CreateView(0, 0,RUNTIME_CLASS(CChTreeView), CSize(300, 350), pContext); m_wndSplitter2.CreateView(1, 0,RUNTIME_CLASS(CShellView), CSize(300, 300), pContext); m_wndSplitter3.CreateStatic(&m_wndSplitter1, 2, 1, WS_CHILD | WS_VISIBLE.. 2008. 2. 18.
두 좌표간의 거리 구하기 #include #include main() { int x1,x2,y1,y2,x,y; double Z; printf("두 좌표값을 순서대로 입력하시오.n"); //값입력받기 printf("첫번째 좌표 : "); scanf("%d %d",&x1,&y1); printf("두번째 좌표 : "); scanf("%d %d",&x2,&y2); //절대치 구하는식 x =(x2-x1)*(x2-x1); y =(y2-y1)*(y2-y1); Z = sqrt(x+y); printf("좌표간거리=%0.2fn",Z); return 0; } 2008. 2. 18.