[C++][MFC] C++(VC++)ã§ãã¤ã¢ãã°ã«æ ç¡ãã®åãã¤ã¢ãã°ãåãè¾¼ã¿ããã¬ã¼ã 管çãå ±éåãå®ç¾ãã
ãã¼ã¸ã§ã³
C++ï¼14
æ¦è¦
ä¾ã¨ãã¦è¤æ°ã®ãã¤ã¢ãã°ã§ãããã¨ãªã¢ãåä¸ã®å ´åã«ãããåãã¤ã¢ãã°ã¨ãã¦ä½æããåãã¤ã¢ãã°ã¯ãããåãè¾¼ãã ãã§å ±éã®ãã¶ã¤ã³ãå®è£ ã§ããã
è¦ç¹
åãã¤ã¢ãã°ã親ãã¤ã¢ãã°ã§åçã«çæããã
åãã¤ã¢ãã°èªä½ãåçã«ã³ã¼ãã£ã³ã°ãã¦ãããããä»åã¯äºãDialogã¨ãã¦ç¨æããã
ã³ã¼ã
â»è¨è¼ãä¸é¨çç¥ãã¦ãã¾ã
â åãã¤ã¢ãã°
VSã®ãªã½ã¼ã¹ãã¥ã¼ã§Dialogãæ°è¦ã§è¿½å ãã¦ã以ä¸ã®å±æ§ãå¤æ´ããã
- IDï¼å¥½ããªIDã«ãä»åã¯IDD_CHILDã«ããã
- Borderï¼ãªãï¼å¿ è¦ãªããç´°æ ãã«ã§ãï¼
- Styleï¼å
â 親ãã¤ã¢ãã°CParent.h
public: std::unique_ptr<CChild> m_child;
â 親ãã¤ã¢ãã°CParent.cpp
ã³ã³ã¹ãã©ã¯ã¿(){ // åã«èªèº«ã®ã¦ã¤ã³ãã¦ãã³ãã©ã渡ãã°ã¯ãªãã¯å¦çãªã©ã§è¦ªã®ã¡ã½ãããå¼ã¹ã m_child = std::unique_ptr<CChild>(new CChild(this)); } 表示å¦ç(){ m_child->Create(IDD_CHILE, this); m_child->ShowWindow(WS_VISIBLE, WS_CHILD); // ããã«åã³ã³ããã¼ã©ã®åæå¦çãªã©ãè¨è¼ m_child->ã»ã(); m_child->MoveWindow(100, 50); m_child->ShowWindow(SW_SHOW); }
åãã¤ã¢ãã°å´ã®åæå¦çï¼ã³ã¼ãã®ã»ãã®é¨åï¼ã§åãã¤ã¢ãã°åºæã®è¨å®ãããã°ããã
ãã¨ãã°ãåçã«ãã¿ã³ãªã©ãçæãããªã©ã
Effective C++ 第3ç (ADDISON-WESLEY PROFESSIONAL COMPUTI)
- ä½è :ã¹ã³ãã ã¡ã¤ã¤ã¼ãº
- çºå£²æ¥: 2014/03/18
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼