|
-
June 7th, 1999, 07:05 AM
#1
CView
How to pass a parameter to the constructor of a CView ?
Thanks in advance.
-
June 7th, 1999, 09:11 AM
#2
Re: CView
You can't Views are constructed using dynamic creation which has no parameters, we use a call back to the doc in OnInitialUpdate and store the needed information there just before creating the view.
HTH,
Chris
-
June 7th, 1999, 09:13 AM
#3
Re: CView
A constructor can take parameters but you have to implement a base constructor anyway.
void MyView::MyView()
{
}
void MyView::MyView(int Param)
{
m_param = Param;
}
C++ will call the correct constructor mechanism for you.
Anyway, you'll see that the constructor if not often a good place to initalize variables members of the view.
It's sometimes better to do that in OnInitialUpdate() or this kind of messages you can intercept.
C++ developer
Faculté de Médecine
27 Bd Jean Moulin
13385 Marseille cedex 05
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
|