본문 바로가기
나머지/IT개발.잡다한것.

[MFC]error C2065: 'm_hWnd' : undeclared identifier 해결 ㅠ_ㅠ

by 무늬만학생 2012. 10. 22.
반응형

error C2065: 'm_hWnd' : undeclared identifier

위와같은 에러가 나오면 m_hWnd멤버를 사용하는 클래스에  "CWnd m_hWnd;" <- 이것을 추가해주면 된다.


사용예제 


class CGrayImageApp : public CWinAppEx

//class CGrayImageApp : public CWnd

{

public:

CGrayImageApp();

CWnd m_hWnd;


위와같이 추가해주면 된다.


참고사이트 

http://social.msdn.microsoft.com/Forums/pl-PL/vcgeneral/thread/39f13330-e3e2-4729-86c5-286e03d07e7f


나중에 한번읽어볼 사이트

CWnd에 대하여  ( http://adnoctum.tistory.com/152 )



참고사이트의 질문글

hi i getting following error on the 4th line

                             RECEIVERINFO ReceiverInfo;

ReceiverInfo.dwSize = sizeof( ReceiverInfo );
ReceiverInfo.dwFlags = 0;
ReceiverInfo.hWnd = m_hWnd;
ReceiverInfo.uMessage = WM_HCTNOTIFY;

how to fix this?


답변

Put this code into a member function of some class that does have m_hWnd  as its data member.



반응형