This is a simple and basic thing...
1.While you create a MFC app SDI...then you add a CFormView as base class for app in last screen of Wizard...
At this moment you will get a dialog support too...OnInitialUpdate() works for that first...mainly it is concerned with dialog' OnInitialUpdate()..
2.Then you insert a class and define CRecordview as its base clas. Thne in App'sView.h file you declare a object of that Class.
3.Then this object is available to you through out yur App'sView.cpp file...where the code for controls like buttons etc too goes and can be handled.
Hope it makes things cleare for you
Let me know if you have any doubt
Hello Pankaj!
Thanx for your reply.But my doubt still remains:
When we go through all the six steps of the wizard for creating the sdi based ODBC application,a CRecordset object is automatically created whne the document object is created
in the InitInstance() function member of the app object.
Similarly, CRecordView object is also created by the wizard.I want to know when and where?
In the book Beginning Visual C++ by Ivor horton, it is written that "OnInitialUpdate() method of the CRecordView classs is called when the record view object is created."My first question answers this too.
What I am talking about is only till when everything is done by the wizard.
Hoping to read your reply,
r_karavadi
Mainly because while you select Database view with/without file support in splash screen of wizard at that moment CRecordView support is given to user. There are other ways too with SDK with whom i have worked in past around a year back..much more complex than MFC.Actually basically you are dealing with Database model at that moment...keep apart front end...MFC is nothing more than front end which is made simpler for your ease.Other front ends are MS Acces,VB too...
Hope things are a bit clear now
Let me know
If I understand you well, you want to know about the sequence of Function calls. In your App-Class within InitInstance you have code looking somehow like following:
This AddDocTemplate finaly creates instances of all Classes (Document, MainFrame and View) and connects them to each other. OnInitialUpdate() is called, when the View is about to be shown. You have a call to the baseclass Member inside this function. With this call all GDI Objects are created from your Resources.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.