logo

English

이곳의 프로그래밍관련 정보와 소스는 마음대로 활용하셔도 좋습니다. 다만 쓰시기 전에 통보 정도는 해주시는 것이 예의 일것 같습니다. 질문이나 오류 수정은 siseong@gmail.com 으로 주세요. 감사합니다.

[MFC] Dialog에서 부모 윈도우 알아내기

by digipine posted Oct 28, 2017
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

A 다이얼로그에서 하나의 버튼을 클릭해서 DoModal()로 다른 하나(B 다이얼로그)의 다이얼로그를 생성할때 B에서 A로 접근할려면 어떻게 해야할까?

 

방법은 간단하다.

 

B다이얼로그 생성자를 오버로딩 하면 된다.

B::B(A *pA)::CDialog(IDD::.....) 

m_pA=pA; 

 

다음 처럼 오버로딩 하고 B클래스 생성시, (A 클래스에서)

 

B dlg(this); 
dlg.DoModal(); 

 

다음처럼 인자로 부모 윈도의 포인터를 넘겨주면 된다.

TAG •

List of Articles
No. Subject Author Date Views
5 GINA(Graphical Identification aNd Authentication), SAS(Secure Attention Sequence) digipine 2017.10.29 1261
4 The .Net Developer's Guide to Directory Services Programming digipine 2017.10.29 7234
3 Customizing GINA, Part 2 digipine 2017.10.28 96755
2 Customizing GINA, Part 1 digipine 2017.10.28 21759
» [MFC] Dialog에서 부모 윈도우 알아내기 digipine 2017.10.28 924
Board Pagination Prev 1 2 3 Next
/ 3