본문 바로가기

c++4

[MFC, C++] 클래스 포인터 얻기 App 클래스에서 CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //App -> MainFrm CClassView *pView=(CClassView *)pMain->GetActiveView(); //App -> MainFrm -> View CClassDoc *pDoc=(CClassDoc *)pMain->GetActiveDocument(); //App -> MainFrm -> Doc View 클래스에서 void CClassView::OnMenuView() CClassApp *pApp=(CClassApp *)AfxGetApp(); //View -> App CMainFrame *pMain=(CMainFrame *)AfxGetMainWnd(); //View -> Main.. 2012. 10. 24.
[MFC, C++] error C2011: "struct' type redefinition에러를 고치다... 데브피아에 질문글 올렸다... 답변 기다리는중... http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=1&MAEULNO=3&no=1479&ref=1479&page=1 내가 올린 질문글 안녕하세요. 에러가 있던걸 고치긴 했는데 왜 고쳐졌는지 몰라서 질문올립니다... -_-;; 일단 아래와 같은 구조체를 Image.h에 정의하였구요. struct ImageInfo {int nW, nH;int nPosX, nPosY; BYTE *Image1D;};이 구조체를 쓰는 도큐멘트에는 아래와 같이 인클루드 했습니다. #include "Image.h" 그런데 error C2011: "struct' type redefinition" error가 나는 것입니다. 정의를 2.. 2012. 10. 24.
AssertValid()에 대해.. AssertValid()에 대해 잘나와있다. http://artwook.tistory.com/entry/ASSERTVALID-AssertValid-Dump MSDN형님http://msdn.microsoft.com/en-us/library/t2za4dew(v=vs.100).aspx The definition of "validity" depends on the object's class. As a rule, the function should perform a "shallow check." That is, if an object contains pointers to other objects, it should check to see whether the pointers are not null, but it .. 2012. 10. 19.
WIN32 메시지 루프에관한 설명이 잘 나와있다. http://www.winprog.org/tutorial/message_loop.html 사이트 이름은 theForger's Win32 API Programming Tutorial 잘나와있다. What is a Message Loopwhile(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } The message loop calls GetMessage(), which looks in your message queue. If the message queue is empty your program basically stops and waits for one (it Blocks).When an event oc.. 2012. 10. 8.
반응형