-
February 3rd, 2003, 01:43 PM
#1
How to use a derived control class in MFC's view?
I have a cutomized control class, when I work on dialog project, I can have a physical control drag drop on the dialog, then use
DDX_Control(pDX, IDC_EXAMPLE2, m_cExample2);
but now I am working on a view, I have to dynamic creat control, but I don't know how to associate that customized control class with my current control without using DDX_Control(...)
Anyone has idea?
-
February 3rd, 2003, 03:04 PM
#2
If you have created the control with the wizard then it should
appear in the list where you add member variables ( using class wiz )
If it is an edit control ( for example ) instead of value select control
and in the combo box below you should see you class.
Other way to do it ( if it dose not appear in this list )
you can rebuild your clw file:
close your project, go to the directory where all files are,
delete MyProjectName.clw file as well as ncd and aps.
reopen your project and click ctrl+w ( to go the class wiz )
select add all files ( ensure that your controls's file are there )
then try to add new member variable,
it should appear there now...
HTH
Kishk91
-
February 3rd, 2003, 03:40 PM
#3
Thanks for your prompt reply!
I create the control dynamically during run time using
m_pVideo->Create("","",WS_CHILD|WS_VISIBLE,rect,this, 200000);
Issure now is i can not use DDX_(...), what else I can use to assocaite my control and that customized control class, using subclass()?
Thanks again
-
February 4th, 2003, 01:25 AM
#4
Hmmm...
But mybe you can use SubClassDlgItem or SubcCassWindow.
I cannot tell you if it will work, due to the fact that i never done it before.
Worth trying....
Good luck,
kishk
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
|