Some WTL - to MFC conversion help
-
Hi respected ATL/WTL/STL people, I need your heeeeeeeelp at once. 1. Tell me, or send me a good wtl tutorial, especially if it contains a comparison between usage of MFC and WTL. or 2. If this look shorter and easier for u, first listen to this and then send me needed answers I need to convert a program from MFC to WTL. 2.1. How should I write this MFC code: SetFont(GetStockFont(DEFAULT_GUI_FONT)); in WTL ? It always tells me: error C3861: 'GetStockFont': identifier not found, even with argument-dependent lookup 2.2. What about this? : CWnd* pWndOwner = GetOwner(); How should THIS ^ MFC line be written in WTL ? 2.3. What does this means and what should I do if it writes to me: error C3861: 'ASSERT': identifier not found, even with argument-dependent lookup That's it Would you be so kind to help me out with this? Please send me the answer for me first and/or my second question at my e-mail: vuchko_@hotmail.com Thank you very much for your help and for your time Greatfull Ajnstajn:-D
-
Hi respected ATL/WTL/STL people, I need your heeeeeeeelp at once. 1. Tell me, or send me a good wtl tutorial, especially if it contains a comparison between usage of MFC and WTL. or 2. If this look shorter and easier for u, first listen to this and then send me needed answers I need to convert a program from MFC to WTL. 2.1. How should I write this MFC code: SetFont(GetStockFont(DEFAULT_GUI_FONT)); in WTL ? It always tells me: error C3861: 'GetStockFont': identifier not found, even with argument-dependent lookup 2.2. What about this? : CWnd* pWndOwner = GetOwner(); How should THIS ^ MFC line be written in WTL ? 2.3. What does this means and what should I do if it writes to me: error C3861: 'ASSERT': identifier not found, even with argument-dependent lookup That's it Would you be so kind to help me out with this? Please send me the answer for me first and/or my second question at my e-mail: vuchko_@hotmail.com Thank you very much for your help and for your time Greatfull Ajnstajn:-D
Ajnstajn wrote: 1. Tell me, or send me a good wtl tutorial Check out Michael Dunn's excelent series of "WTL for MFC Programmers" articles http://codeproject.com/wtl/wtl4mfc1.asp[^] Ajnstajn wrote: GetStockFont(DEFAULT_GUI_FONT)); You could try AtlGetStockFont(DEFAULT_GUI_FONT); If you look at it's source in atlmisc.h, you see that it's just a wrapper for ::GetStockObject() Ajnstajn wrote: 2.2. What about this? : CWnd* pWndOwner = GetOwner(); How should THIS ^ MFC line be written in WTL ? Well looking at the MFC source (it's always a good thing to install the MFC source when installing devstudio - you'll never know what you'll learn) CWnd::GetOwner looks like this
_AFXWIN_INLINE CWnd* CWnd::GetOwner() const
{ return m_hWndOwner != NULL ? CWnd::FromHandle(m_hWndOwner) : GetParent(); }Depending on your situation, you could probably replace it with someing like
CWindow wndOwner = GetParent()
. Presuming that you are in a CWindow object ;-) Ajnstajn wrote: 'ASSERT': identifier not found Use ATLASSERT But seriously, check out Michael Dunn's articles, there all found in the WTL section here on CodeProject http://codeproject.com/wtl/index.asp#Beginners[^] You'll learn a lot. [ Jason De Arte | Toy Maker | 1001010.com ]