|
-
Dec 17th, 2002, 02:11 AM
#1
Thread Starter
Addicted Member
-
Dec 17th, 2002, 06:37 AM
#2
Tick the "Disable smilies in this post" to avoid your class derivations be converted to smilies.
CWinThread has a member named m_pMainWnd of type CWnd*. In InitInstance you create a new MyFrame object on the heap and assign the pointer to this variable:
m_pMainWnd = new MyFrame();
Then you have to add a message map to MyFrame. Catch the WM_CREATE message (ON_WM_CREATE() -> int OnCreate(LPCREATESTRUCT pCS)) and create the view there. Make it a class member, CFrameWnd provides no mechanism for that. It was made to use document templates and views.
In the class declaration of MyFrame:
MyWin m_win;
In OnCreate:
m_win.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST, NULL);
You should also check for an error return.
This is the bare minimum. You should also override CFrameWnd::OnCmdMsg and forward the messages to the client window, as well as forwarding the focus in OnSetFocus (response to WM_SETFOCUS).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|