It is currently Sat, 25 Oct 2014 11:55:21 GMT



 
Author Message
 where to put SubClassDlgItem in a CFormView?

I'd like to subclass a CComboBox in a CFormView.  I've prepared the DrawItem and MeasureItem and CompareItem.  Now with a CDialog the call to SubClassItem goes in the OnInitDialog but where does it go in a CFormView?

I've tried putting it in OnInitialUpdate and PreSubClassWindow without success.  My problem is an ASSERT(m_hWnd == NULL) in the Attach function in wincore.cpp.  Or is there something extra I need to do?

thanks a bunch,
Wing



 Tue, 23 Jul 2002 03:00:00 GMT   
 where to put SubClassDlgItem in a CFormView?

Solved it!

Solution:
When the class wizard sets up the member variable for the subclassed control (the combo box in my case) the DDX statement, added by ClassWizard, already subclassed the control.  There is no need to call SubClassDlgItem.  The assertion is caused by SubClassDlgItem subclassing the control the second time (after the DDX statement).

This seems to be a common confusion amongst most books and documentation I've come across, including the msdn knowledge base.

soldier on,
Wing



 Tue, 23 Jul 2002 03:00:00 GMT   
 
   [ 2 post ] 

Similar Threads

1.problem in putting OK button for Cformview based Dialog Form

hi 
  I created a class for my Dialog form .This class has
  CFormView as base class instead of CDialog. Since base
class is CFormView 'OK' button won't appear in the
Titlebar of this dialog form.I tried using SHDoneButton().
I got the  OK button, but on click of it the whole
application closes. Please help me in this

I am using PocketPC, evc++, Wince
Hoping for an early reply
Thanx

2. How to put a CView into a CFormView ?

3. Put a CView inside a CFormView

4. Problems with CFormView inside CFormView (mnemonic keys)

5. Error doing SubclassDlgItem

6. Un - SubClassDlgItem ???

7. How to put a CFormView-based window onto any CWnd?

8. Multiple forms with CFormView

9. Scrollbasr in CFormView

10. How to have something like a CFormView as a dialog


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software