Accessing the members of another class with the help of ClassWizard.
For Example:
When doing a CRecordSetView you have access to the CRecordSet data members in class wizard.
I use Formview with Dialog boxes. I want to be able to access the FormView datamembers directly from class wizard without having to define a member variable for the CDialog Class and then assigning the value to the CFormview member variable.
If you do it right you classwizard will create the following:
is a pointer to the Formview class which called the CDialog class. I can then edit the Formview data members directly without having to create an extra variable and assignment statements.
For Example I did the following:
void CMyFormView::OnButtonDialog1()
{
// TODO: Add your control notification handler code here
And I'm able to access the Formview Vars and edit them directly. Classwizard will list all the CFormView Vars so I can edit them directly.
I'm surprised that there is not much info on this approach to using CDialog since it is more effiecient (computing and memory wise) as well esier to code. I don't even have to filter ID_OK since the framework does it already. Data will only be updated if you hit OnOk.
VS6, it has a class wizard. I read that VS2003 and up don't have a class wizard, up until VS2010.
They actually did away with it in VS2002 that followed VS6, and you're correct they resurrected it in VS2010. IMO, I really liked the class wizard in VS6 and was missing it a big time in VS2002, but as time passed (8 years for god's sake) I got used to the other way so now I'm not sure if I'd be going back to the wizard in VS2010 any time soon. The Add Member and Add Function replacements introuced in VS2002 that stayed until VS2008 are so fickle and unreliable that I learned to code most of my class members manually (without using any sort of IDE automation).
Another thing that suffered a big time (in my opinion) is the Intellisense (since VS2003). Even though they added some good features to it (like the ability to unfold and view structures during debugging) it is still very slow to respond and at times doesn't show the correct or helpful info. I really want it to go back to the way it used to be in VS6 or VS2002.
On the sidenote, I'm not sure that I'd be using VS2010 any time soon either. The reason is simple -- the CRT and MFC (that I'm using the most) are so bloated in size, plus the code VS2010 compiler makes is only compatible with Windows XP and up, so I'm going to stick with VS2008 w/o SP1 for awhile.
A question I have to you, is it actually legal (or documented) to use class members like you do? It wouldn't cause some internal conflict with the MFC stuff itself, would it? (If you want to post a sample of what you're doing and I can test it to see if it works under VS2010)
which should be ok because you are just pointing to a string.
You can try this youself, create a pointer to another dialog box and access the member via a pointer, you should be able to update the varialbe.
I do have a question for you though, in VS2003 and Up, when you do a CDAORECORDVIEW or CRECORDVIEW does VS give you a list of database fields when you are biniding variables to the Editbox's?
I do have a question for you though, in VS2003 and Up, when you do a CDAORECORDVIEW or CRECORDVIEW does VS give you a list of database fields when you are biniding variables to the Editbox's?
Listen, I haven't done anything with databases for quite a long time. Either post a test project with what you mean, or give me the database specs you're using in your project?
Bookmarks